|
| 1 | +# ItemsSchema |
| 2 | +org.openapijsonschematools.client.components.schemas.ItemsSchema.java |
| 3 | +public class ItemsSchema<br> |
| 4 | + |
| 5 | +A class that contains necessary nested |
| 6 | +- schema classes (which validate payloads), extends JsonSchema |
| 7 | +- sealed interfaces which store validated payloads, java version of a sum type |
| 8 | +- boxed classes which store validated payloads, sealed permits class implementations |
| 9 | +- classes to store validated map payloads, extends FrozenMap |
| 10 | +- classes to build inputs for map payloads |
| 11 | + |
| 12 | +## Nested Class Summary |
| 13 | +| Modifier and Type | Class and Description | |
| 14 | +| ----------------- | ---------------------- | |
| 15 | +| sealed interface | [ItemsSchema.ItemsSchema1Boxed](#itemsschema1boxed)<br> sealed interface for validated payloads | |
| 16 | +| record | [ItemsSchema.ItemsSchema1BoxedMap](#itemsschema1boxedmap)<br> boxed class to store validated Map payloads | |
| 17 | +| static class | [ItemsSchema.ItemsSchema1](#itemsschema1)<br> schema class | |
| 18 | +| static class | [ItemsSchema.ItemsSchemaMapBuilder](#itemsschemamapbuilder)<br> builder for Map payloads | |
| 19 | +| static class | [ItemsSchema.ItemsSchemaMap](#itemsschemamap)<br> output class for Map payloads | |
| 20 | +| sealed interface | [ItemsSchema.SecondAdditionalPropertyBoxed](#secondadditionalpropertyboxed)<br> sealed interface for validated payloads | |
| 21 | +| record | [ItemsSchema.SecondAdditionalPropertyBoxedString](#secondadditionalpropertyboxedstring)<br> boxed class to store validated String payloads | |
| 22 | +| static class | [ItemsSchema.SecondAdditionalProperty](#secondadditionalproperty)<br> schema class | |
| 23 | +| sealed interface | [ItemsSchema.AdditionalPropertyBoxed](#additionalpropertyboxed)<br> sealed interface for validated payloads | |
| 24 | +| record | [ItemsSchema.AdditionalPropertyBoxedString](#additionalpropertyboxedstring)<br> boxed class to store validated String payloads | |
| 25 | +| static class | [ItemsSchema.AdditionalProperty](#additionalproperty)<br> schema class | |
| 26 | +| sealed interface | [ItemsSchema.NameBoxed](#nameboxed)<br> sealed interface for validated payloads | |
| 27 | +| record | [ItemsSchema.NameBoxedString](#nameboxedstring)<br> boxed class to store validated String payloads | |
| 28 | +| static class | [ItemsSchema.Name](#name)<br> schema class | |
| 29 | + |
| 30 | +## ItemsSchema1Boxed |
| 31 | +public sealed interface ItemsSchema1Boxed<br> |
| 32 | +permits<br> |
| 33 | +[ItemsSchema1BoxedMap](#itemsschema1boxedmap) |
| 34 | + |
| 35 | +sealed interface that stores validated payloads using boxed classes |
| 36 | + |
| 37 | +## ItemsSchema1BoxedMap |
| 38 | +public record ItemsSchema1BoxedMap<br> |
| 39 | +implements [ItemsSchema1Boxed](#itemsschema1boxed) |
| 40 | + |
| 41 | +record that stores validated Map payloads, sealed permits implementation |
| 42 | + |
| 43 | +### Constructor Summary |
| 44 | +| Constructor and Description | |
| 45 | +| --------------------------- | |
| 46 | +| ItemsSchema1BoxedMap([ItemsSchemaMap](#itemsschemamap) data)<br>Creates an instance, private visibility | |
| 47 | + |
| 48 | +### Method Summary |
| 49 | +| Modifier and Type | Method and Description | |
| 50 | +| ----------------- | ---------------------- | |
| 51 | +| [ItemsSchemaMap](#itemsschemamap) | data()<br>validated payload | |
| 52 | +| @Nullable Object | getData()<br>validated payload | |
| 53 | + |
| 54 | +## ItemsSchema1 |
| 55 | +public static class ItemsSchema1<br> |
| 56 | +extends JsonSchema |
| 57 | + |
| 58 | +A schema class that validates payloads |
| 59 | + |
| 60 | +### Code Sample |
| 61 | +``` |
| 62 | +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; |
| 63 | +import org.openapijsonschematools.client.configurations.SchemaConfiguration; |
| 64 | +import org.openapijsonschematools.client.exceptions.ValidationException; |
| 65 | +import org.openapijsonschematools.client.schemas.validation.MapUtils; |
| 66 | +import org.openapijsonschematools.client.schemas.validation.FrozenList; |
| 67 | +import org.openapijsonschematools.client.schemas.validation.FrozenMap; |
| 68 | +import org.openapijsonschematools.client.components.schemas.ItemsSchema; |
| 69 | +
|
| 70 | +import java.util.Arrays; |
| 71 | +import java.util.List; |
| 72 | +import java.util.AbstractMap; |
| 73 | +
|
| 74 | +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); |
| 75 | +
|
| 76 | +// Map validation |
| 77 | +ItemsSchema.ItemsSchemaMap validatedPayload = |
| 78 | + ItemsSchema.ItemsSchema1.validate( |
| 79 | + new ItemsSchema.ItemsSchemaMapBuilder() |
| 80 | + .name("a") |
| 81 | +
|
| 82 | + .additionalProperty("a") |
| 83 | +
|
| 84 | + .secondAdditionalProperty("a") |
| 85 | +
|
| 86 | + .build(), |
| 87 | + configuration |
| 88 | +); |
| 89 | +``` |
| 90 | + |
| 91 | +### Field Summary |
| 92 | +| Modifier and Type | Field and Description | |
| 93 | +| ----------------- | ---------------------- | |
| 94 | +| Set<Class<?>> | type = Set.of(Map.class) | |
| 95 | +| Map<String, Class<? extends JsonSchema>> | properties = Map.ofEntries(<br> new PropertyEntry("name", [Name.class](#name))),<br> new PropertyEntry("additionalProperty", [AdditionalProperty.class](#additionalproperty))),<br> new PropertyEntry("secondAdditionalProperty", [SecondAdditionalProperty.class](#secondadditionalproperty)))<br>)<br> | |
| 96 | + |
| 97 | +### Method Summary |
| 98 | +| Modifier and Type | Method and Description | |
| 99 | +| ----------------- | ---------------------- | |
| 100 | +| [ItemsSchemaMap](#itemsschemamap) | validate([Map<?, ?>](#itemsschemamapbuilder) arg, SchemaConfiguration configuration) | |
| 101 | +| [ItemsSchema1BoxedMap](#itemsschema1boxedmap) | validateAndBox([Map<?, ?>](#itemsschemamapbuilder) arg, SchemaConfiguration configuration) | |
| 102 | +| [ItemsSchema1Boxed](#itemsschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | |
| 103 | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | |
| 104 | + |
| 105 | +## ItemsSchemaMapBuilder |
| 106 | +public class ItemsSchemaMapBuilder<br> |
| 107 | +builder for `Map<String, @Nullable Object>` |
| 108 | + |
| 109 | +A class that builds the Map input type |
| 110 | + |
| 111 | +### Constructor Summary |
| 112 | +| Constructor and Description | |
| 113 | +| --------------------------- | |
| 114 | +| ItemsSchemaMapBuilder()<br>Creates a builder that contains an empty map | |
| 115 | + |
| 116 | +### Method Summary |
| 117 | +| Modifier and Type | Method and Description | |
| 118 | +| ----------------- | ---------------------- | |
| 119 | +| Map<String, @Nullable Object> | build()<br>Returns map input that should be used with Schema.validate | |
| 120 | +| [ItemsSchemaMapBuilder](#itemsschemamapbuilder) | name(String value) | |
| 121 | +| [ItemsSchemaMapBuilder](#itemsschemamapbuilder) | additionalProperty(String value) | |
| 122 | +| [ItemsSchemaMapBuilder](#itemsschemamapbuilder) | secondAdditionalProperty(String value) | |
| 123 | +| [ItemsSchemaMapBuilder](#itemsschemamapbuilder) | additionalProperty(String key, Void value) | |
| 124 | +| [ItemsSchemaMapBuilder](#itemsschemamapbuilder) | additionalProperty(String key, boolean value) | |
| 125 | +| [ItemsSchemaMapBuilder](#itemsschemamapbuilder) | additionalProperty(String key, String value) | |
| 126 | +| [ItemsSchemaMapBuilder](#itemsschemamapbuilder) | additionalProperty(String key, int value) | |
| 127 | +| [ItemsSchemaMapBuilder](#itemsschemamapbuilder) | additionalProperty(String key, float value) | |
| 128 | +| [ItemsSchemaMapBuilder](#itemsschemamapbuilder) | additionalProperty(String key, long value) | |
| 129 | +| [ItemsSchemaMapBuilder](#itemsschemamapbuilder) | additionalProperty(String key, double value) | |
| 130 | +| [ItemsSchemaMapBuilder](#itemsschemamapbuilder) | additionalProperty(String key, List<?> value) | |
| 131 | +| [ItemsSchemaMapBuilder](#itemsschemamapbuilder) | additionalProperty(String key, Map<String, ?> value) | |
| 132 | + |
| 133 | +## ItemsSchemaMap |
| 134 | +public static class ItemsSchemaMap<br> |
| 135 | +extends FrozenMap<String, @Nullable Object> |
| 136 | + |
| 137 | +A class to store validated Map payloads |
| 138 | + |
| 139 | +### Method Summary |
| 140 | +| Modifier and Type | Method and Description | |
| 141 | +| ----------------- | ---------------------- | |
| 142 | +| static [ItemsSchemaMap](#itemsschemamap) | of([Map<String, ? extends @Nullable Object>](#itemsschemamapbuilder) arg, SchemaConfiguration configuration) | |
| 143 | +| String | name()<br>[optional] | |
| 144 | +| String | additionalProperty()<br>[optional] | |
| 145 | +| String | secondAdditionalProperty()<br>[optional] | |
| 146 | +| @Nullable Object | getAdditionalProperty(String name)<br>provides type safety for additional properties | |
| 147 | + |
| 148 | +## SecondAdditionalPropertyBoxed |
| 149 | +public sealed interface SecondAdditionalPropertyBoxed<br> |
| 150 | +permits<br> |
| 151 | +[SecondAdditionalPropertyBoxedString](#secondadditionalpropertyboxedstring) |
| 152 | + |
| 153 | +sealed interface that stores validated payloads using boxed classes |
| 154 | + |
| 155 | +## SecondAdditionalPropertyBoxedString |
| 156 | +public record SecondAdditionalPropertyBoxedString<br> |
| 157 | +implements [SecondAdditionalPropertyBoxed](#secondadditionalpropertyboxed) |
| 158 | + |
| 159 | +record that stores validated String payloads, sealed permits implementation |
| 160 | + |
| 161 | +### Constructor Summary |
| 162 | +| Constructor and Description | |
| 163 | +| --------------------------- | |
| 164 | +| SecondAdditionalPropertyBoxedString(String data)<br>Creates an instance, private visibility | |
| 165 | + |
| 166 | +### Method Summary |
| 167 | +| Modifier and Type | Method and Description | |
| 168 | +| ----------------- | ---------------------- | |
| 169 | +| String | data()<br>validated payload | |
| 170 | +| @Nullable Object | getData()<br>validated payload | |
| 171 | + |
| 172 | +## SecondAdditionalProperty |
| 173 | +public static class SecondAdditionalProperty<br> |
| 174 | +extends StringJsonSchema.StringJsonSchema1 |
| 175 | + |
| 176 | +A schema class that validates payloads |
| 177 | + |
| 178 | +| Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema.StringJsonSchema1 | |
| 179 | +| ------------------------------------------------------------------ | |
| 180 | +| validate | |
| 181 | +| validateAndBox | |
| 182 | + |
| 183 | +## AdditionalPropertyBoxed |
| 184 | +public sealed interface AdditionalPropertyBoxed<br> |
| 185 | +permits<br> |
| 186 | +[AdditionalPropertyBoxedString](#additionalpropertyboxedstring) |
| 187 | + |
| 188 | +sealed interface that stores validated payloads using boxed classes |
| 189 | + |
| 190 | +## AdditionalPropertyBoxedString |
| 191 | +public record AdditionalPropertyBoxedString<br> |
| 192 | +implements [AdditionalPropertyBoxed](#additionalpropertyboxed) |
| 193 | + |
| 194 | +record that stores validated String payloads, sealed permits implementation |
| 195 | + |
| 196 | +### Constructor Summary |
| 197 | +| Constructor and Description | |
| 198 | +| --------------------------- | |
| 199 | +| AdditionalPropertyBoxedString(String data)<br>Creates an instance, private visibility | |
| 200 | + |
| 201 | +### Method Summary |
| 202 | +| Modifier and Type | Method and Description | |
| 203 | +| ----------------- | ---------------------- | |
| 204 | +| String | data()<br>validated payload | |
| 205 | +| @Nullable Object | getData()<br>validated payload | |
| 206 | + |
| 207 | +## AdditionalProperty |
| 208 | +public static class AdditionalProperty<br> |
| 209 | +extends StringJsonSchema.StringJsonSchema1 |
| 210 | + |
| 211 | +A schema class that validates payloads |
| 212 | + |
| 213 | +| Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema.StringJsonSchema1 | |
| 214 | +| ------------------------------------------------------------------ | |
| 215 | +| validate | |
| 216 | +| validateAndBox | |
| 217 | + |
| 218 | +## NameBoxed |
| 219 | +public sealed interface NameBoxed<br> |
| 220 | +permits<br> |
| 221 | +[NameBoxedString](#nameboxedstring) |
| 222 | + |
| 223 | +sealed interface that stores validated payloads using boxed classes |
| 224 | + |
| 225 | +## NameBoxedString |
| 226 | +public record NameBoxedString<br> |
| 227 | +implements [NameBoxed](#nameboxed) |
| 228 | + |
| 229 | +record that stores validated String payloads, sealed permits implementation |
| 230 | + |
| 231 | +### Constructor Summary |
| 232 | +| Constructor and Description | |
| 233 | +| --------------------------- | |
| 234 | +| NameBoxedString(String data)<br>Creates an instance, private visibility | |
| 235 | + |
| 236 | +### Method Summary |
| 237 | +| Modifier and Type | Method and Description | |
| 238 | +| ----------------- | ---------------------- | |
| 239 | +| String | data()<br>validated payload | |
| 240 | +| @Nullable Object | getData()<br>validated payload | |
| 241 | + |
| 242 | +## Name |
| 243 | +public static class Name<br> |
| 244 | +extends StringJsonSchema.StringJsonSchema1 |
| 245 | + |
| 246 | +A schema class that validates payloads |
| 247 | + |
| 248 | +| Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema.StringJsonSchema1 | |
| 249 | +| ------------------------------------------------------------------ | |
| 250 | +| validate | |
| 251 | +| validateAndBox | |
| 252 | + |
| 253 | +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) |
0 commit comments