|
| 1 | +# AdditionalpropertiesAllowsASchemaWhichShouldValidate |
| 2 | +org.openapijsonschematools.client.components.schemas.AdditionalpropertiesAllowsASchemaWhichShouldValidate.java |
| 3 | +public class AdditionalpropertiesAllowsASchemaWhichShouldValidate |
| 4 | + |
| 5 | +A class that contains necessary nested |
| 6 | +- schema classes (which validate payloads), extends JsonSchema |
| 7 | +- classes to store validated list payloads, extends FrozenList |
| 8 | +- classes to store validated map payloads, extends FrozenMap |
| 9 | +- classes to build inputs for list payloads |
| 10 | +- classes to build inputs for map payloads |
| 11 | + |
| 12 | +## Nested Class Summary |
| 13 | +| Modifier and Type | Class and Description | |
| 14 | +| ----------------- | ---------------------- | |
| 15 | +| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalpropertiesAllowsASchemaWhichShouldValidate1](#additionalpropertiesallowsaschemawhichshouldvalidate1)<br> schema class | |
| 16 | +| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalpropertiesAllowsASchemaWhichShouldValidateMapInput](#additionalpropertiesallowsaschemawhichshouldvalidatemapinput)<br> builder for Map payloads | |
| 17 | +| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalpropertiesAllowsASchemaWhichShouldValidateMap](#additionalpropertiesallowsaschemawhichshouldvalidatemap)<br> output class for Map payloads | |
| 18 | +| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.Bar](#bar)<br> schema class | |
| 19 | +| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.Foo](#foo)<br> schema class | |
| 20 | +| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalProperties](#additionalproperties)<br> schema class | |
| 21 | + |
| 22 | +## AdditionalpropertiesAllowsASchemaWhichShouldValidate1 |
| 23 | +public static class AdditionalpropertiesAllowsASchemaWhichShouldValidate1<br> |
| 24 | +extends JsonSchema |
| 25 | + |
| 26 | +A schema class that validates payloads |
| 27 | + |
| 28 | +### Code Sample |
| 29 | +``` |
| 30 | +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; |
| 31 | +import org.openapijsonschematools.client.configurations.SchemaConfiguration; |
| 32 | +import org.openapijsonschematools.client.exceptions.ValidationException; |
| 33 | +import org.openapijsonschematools.client.schemas.MapMaker; |
| 34 | +import org.openapijsonschematools.client.schemas.validation.FrozenList; |
| 35 | +import org.openapijsonschematools.client.schemas.validation.FrozenMap; |
| 36 | +
|
| 37 | +import java.util.Arrays; |
| 38 | +import java.util.List; |
| 39 | +import java.util.AbstractMap; |
| 40 | +
|
| 41 | +static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); |
| 42 | +
|
| 43 | +// Map validation |
| 44 | +AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalpropertiesAllowsASchemaWhichShouldValidateMap validatedPayload = |
| 45 | + AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalpropertiesAllowsASchemaWhichShouldValidate1.validate( |
| 46 | + MapMaker.makeMap( |
| 47 | + ), |
| 48 | + configuration |
| 49 | +); |
| 50 | +``` |
| 51 | + |
| 52 | +### Field Summary |
| 53 | +| Modifier and Type | Field and Description | |
| 54 | +| ----------------- | ---------------------- | |
| 55 | +| Set<Class<?>> | type = Set.of(Map.class)<br/> | |
| 56 | +| Map<String, Class<? extends JsonSchema>> | properties = Map.ofEntries(<br> new PropertyEntry("foo", [Foo.class](#foo))),<br> new PropertyEntry("bar", [Bar.class](#bar)))<br> )<br> | |
| 57 | +| Class<? extends JsonSchema> | additionalProperties = [AdditionalProperties.class](#additionalproperties)<br> | |
| 58 | + |
| 59 | +### Method Summary |
| 60 | +| Modifier and Type | Method and Description | |
| 61 | +| ----------------- | ---------------------- | |
| 62 | +| static [AdditionalpropertiesAllowsASchemaWhichShouldValidateMap](#additionalpropertiesallowsaschemawhichshouldvalidatemap) | validate([Map<String, Object>](#additionalpropertiesallowsaschemawhichshouldvalidatemapinput) arg, SchemaConfiguration configuration) | |
| 63 | + |
| 64 | +## AdditionalpropertiesAllowsASchemaWhichShouldValidateMapInput |
| 65 | +public class AdditionalpropertiesAllowsASchemaWhichShouldValidateMapInput<br> |
| 66 | +builder for `Map<String, Object>` |
| 67 | + |
| 68 | +A class that builds the Map input type |
| 69 | + |
| 70 | +## Input Map Keys |
| 71 | +| Key | Type | Description | Notes | |
| 72 | +| --- | ---- | ------------ | ----- | |
| 73 | +| **foo** | Object | | [optional] | |
| 74 | +| **bar** | Object | | [optional] | |
| 75 | +| **anyStringName** | boolean | any string name can be used but the value must be the correct type | [optional] | |
| 76 | + |
| 77 | +## AdditionalpropertiesAllowsASchemaWhichShouldValidateMap |
| 78 | +public static class AdditionalpropertiesAllowsASchemaWhichShouldValidateMap<br> |
| 79 | +extends FrozenMap<String, Object> |
| 80 | + |
| 81 | +A class to store validated Map payloads |
| 82 | + |
| 83 | +### Method Summary |
| 84 | +| Modifier and Type | Method and Description | |
| 85 | +| ----------------- | ---------------------- | |
| 86 | +| static [AdditionalpropertiesAllowsASchemaWhichShouldValidateMap](#additionalpropertiesallowsaschemawhichshouldvalidatemap) | of([Map<String, Object>](#additionalpropertiesallowsaschemawhichshouldvalidatemapinput) arg, SchemaConfiguration configuration) | |
| 87 | +| Object | foo()<br>[optional] | |
| 88 | +| Object | bar()<br>[optional] | |
| 89 | +| boolean | getAdditionalProperty(String name)<br>provides type safety for additional properties | |
| 90 | + |
| 91 | +## Bar |
| 92 | +public static class Bar<br> |
| 93 | +extends AnyTypeJsonSchema |
| 94 | + |
| 95 | +A schema class that validates payloads |
| 96 | + |
| 97 | +| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema | |
| 98 | +| ------------------------------------------------------------------ | |
| 99 | +| validate | |
| 100 | + |
| 101 | +## Foo |
| 102 | +public static class Foo<br> |
| 103 | +extends AnyTypeJsonSchema |
| 104 | + |
| 105 | +A schema class that validates payloads |
| 106 | + |
| 107 | +| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema | |
| 108 | +| ------------------------------------------------------------------ | |
| 109 | +| validate | |
| 110 | + |
| 111 | +## AdditionalProperties |
| 112 | +public static class AdditionalProperties<br> |
| 113 | +extends BooleanJsonSchema |
| 114 | + |
| 115 | +A schema class that validates payloads |
| 116 | + |
| 117 | +| Methods Inherited from class org.openapijsonschematools.client.schemas.BooleanJsonSchema | |
| 118 | +| ------------------------------------------------------------------ | |
| 119 | +| validate | |
| 120 | + |
| 121 | +[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) |
0 commit comments