@@ -6,6 +6,8 @@ A class that contains necessary nested
6
6
- schema classes (which validate payloads), extends JsonSchema
7
7
- sealed interfaces which store validated payloads, java version of a sum type
8
8
- boxed classes which store validated payloads, sealed permits class implementations
9
+ - classes to store validated list payloads, extends FrozenList
10
+ - classes to build inputs for list payloads
9
11
- classes to store validated map payloads, extends FrozenMap
10
12
- classes to build inputs for map payloads
11
13
@@ -17,6 +19,12 @@ A class that contains necessary nested
17
19
| static class | [ ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalProps1] ( #objectwithonlyoptionalprops1 ) <br > schema class |
18
20
| static class | [ ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalPropsMapBuilder] ( #objectwithonlyoptionalpropsmapbuilder ) <br > builder for Map payloads |
19
21
| static class | [ ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalPropsMap] ( #objectwithonlyoptionalpropsmap ) <br > output class for Map payloads |
22
+ | sealed interface | [ ObjectWithOnlyOptionalProps.ArrayPropertyBoxed] ( #arraypropertyboxed ) <br > sealed interface for validated payloads |
23
+ | record | [ ObjectWithOnlyOptionalProps.ArrayPropertyBoxedVoid] ( #arraypropertyboxedvoid ) <br > boxed class to store validated null payloads |
24
+ | record | [ ObjectWithOnlyOptionalProps.ArrayPropertyBoxedList] ( #arraypropertyboxedlist ) <br > boxed class to store validated List payloads |
25
+ | static class | [ ObjectWithOnlyOptionalProps.ArrayProperty] ( #arrayproperty ) <br > schema class |
26
+ | static class | [ ObjectWithOnlyOptionalProps.ArrayPropertyListBuilder] ( #arraypropertylistbuilder ) <br > builder for List payloads |
27
+ | static class | [ ObjectWithOnlyOptionalProps.ArrayPropertyList] ( #arraypropertylist ) <br > output class for List payloads |
20
28
| sealed interface | [ ObjectWithOnlyOptionalProps.BBoxed] ( #bboxed ) <br > sealed interface for validated payloads |
21
29
| record | [ ObjectWithOnlyOptionalProps.BBoxedNumber] ( #bboxednumber ) <br > boxed class to store validated Number payloads |
22
30
| static class | [ ObjectWithOnlyOptionalProps.B] ( #b ) <br > schema class |
@@ -86,6 +94,8 @@ ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalPropsMap validatedPayload =
86
94
87
95
.b(1)
88
96
97
+ .ArrayProperty(null)
98
+
89
99
.build(),
90
100
configuration
91
101
);
@@ -95,7 +105,7 @@ ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalPropsMap validatedPayload =
95
105
| Modifier and Type | Field and Description |
96
106
| ----------------- | ---------------------- |
97
107
| Set<Class<?>> | type = Set.of(Map.class) |
98
- | Map<String, Class<? extends JsonSchema>> | properties = Map.ofEntries(<br >  ;  ;  ;  ; new PropertyEntry("a", [ A.class] ( #a ) )),<br >  ;  ;  ;  ; new PropertyEntry("b", [ B.class] ( #b ) ))<br >)<br > |
108
+ | Map<String, Class<? extends JsonSchema>> | properties = Map.ofEntries(<br >  ;  ;  ;  ; new PropertyEntry("a", [ A.class] ( #a ) )),<br >  ;  ;  ;  ; new PropertyEntry("b", [ B.class] ( #b ) )),< br > & nbsp ;& nbsp ;& nbsp ;& nbsp ; new PropertyEntry("ArrayProperty", [ ArrayProperty.class ] ( #arrayproperty ) )) <br >)<br > |
99
109
| Class<? extends JsonSchema> | additionalProperties = [ AdditionalProperties.class] ( #additionalproperties ) |
100
110
101
111
### Method Summary
@@ -108,7 +118,7 @@ ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalPropsMap validatedPayload =
108
118
109
119
## ObjectWithOnlyOptionalPropsMapBuilder
110
120
public class ObjectWithOnlyOptionalPropsMapBuilder<br >
111
- builder for ` Map<String, Object> `
121
+ builder for ` Map<String, @Nullable Object> `
112
122
113
123
A class that builds the Map input type
114
124
@@ -120,25 +130,155 @@ A class that builds the Map input type
120
130
### Method Summary
121
131
| Modifier and Type | Method and Description |
122
132
| ----------------- | ---------------------- |
123
- | Map<String, Object> | build()<br >Returns map input that should be used with Schema.validate |
133
+ | Map<String, @ Nullable Object> | build()<br >Returns map input that should be used with Schema.validate |
124
134
| [ ObjectWithOnlyOptionalPropsMapBuilder] ( #objectwithonlyoptionalpropsmapbuilder ) | a(String value) |
125
135
| [ ObjectWithOnlyOptionalPropsMapBuilder] ( #objectwithonlyoptionalpropsmapbuilder ) | b(int value) |
126
136
| [ ObjectWithOnlyOptionalPropsMapBuilder] ( #objectwithonlyoptionalpropsmapbuilder ) | b(float value) |
127
137
| [ ObjectWithOnlyOptionalPropsMapBuilder] ( #objectwithonlyoptionalpropsmapbuilder ) | b(long value) |
128
138
| [ ObjectWithOnlyOptionalPropsMapBuilder] ( #objectwithonlyoptionalpropsmapbuilder ) | b(double value) |
139
+ | [ ObjectWithOnlyOptionalPropsMapBuilder] ( #objectwithonlyoptionalpropsmapbuilder ) | ArrayProperty(Void value) |
140
+ | [ ObjectWithOnlyOptionalPropsMapBuilder] ( #objectwithonlyoptionalpropsmapbuilder ) | ArrayProperty(List<String > value) |
129
141
130
142
## ObjectWithOnlyOptionalPropsMap
131
143
public static class ObjectWithOnlyOptionalPropsMap<br >
132
- extends FrozenMap<String, Object>
144
+ extends FrozenMap<String, @ Nullable Object>
133
145
134
146
A class to store validated Map payloads
135
147
136
148
### Method Summary
137
149
| Modifier and Type | Method and Description |
138
150
| ----------------- | ---------------------- |
139
- | static [ ObjectWithOnlyOptionalPropsMap] ( #objectwithonlyoptionalpropsmap ) | of([ Map<String, Object>] ( #objectwithonlyoptionalpropsmapbuilder ) arg, SchemaConfiguration configuration) |
151
+ | static [ ObjectWithOnlyOptionalPropsMap] ( #objectwithonlyoptionalpropsmap ) | of([ Map<String, ? extends @ Nullable Object>] ( #objectwithonlyoptionalpropsmapbuilder ) arg, SchemaConfiguration configuration) |
140
152
| String | a()<br >[ optional] |
141
153
| Number | b()<br >[ optional] |
154
+ | [ ArrayPropertyList] ( #arraypropertylist ) | ArrayProperty()<br >[ optional] |
155
+
156
+ ## ArrayPropertyBoxed
157
+ public sealed interface ArrayPropertyBoxed<br >
158
+ permits<br >
159
+ [ ArrayPropertyBoxedVoid] ( #arraypropertyboxedvoid ) ,
160
+ [ ArrayPropertyBoxedList] ( #arraypropertyboxedlist )
161
+
162
+ sealed interface that stores validated payloads using boxed classes
163
+
164
+ ## ArrayPropertyBoxedVoid
165
+ public record ArrayPropertyBoxedVoid<br >
166
+ implements [ ArrayPropertyBoxed] ( #arraypropertyboxed )
167
+
168
+ record that stores validated null payloads, sealed permits implementation
169
+
170
+ ### Constructor Summary
171
+ | Constructor and Description |
172
+ | --------------------------- |
173
+ | ArrayPropertyBoxedVoid(Void data)<br >Creates an instance, private visibility |
174
+
175
+ ### Method Summary
176
+ | Modifier and Type | Method and Description |
177
+ | ----------------- | ---------------------- |
178
+ | Void | data()<br >validated payload |
179
+ | @Nullable Object | getData()<br >validated payload |
180
+
181
+ ## ArrayPropertyBoxedList
182
+ public record ArrayPropertyBoxedList<br >
183
+ implements [ ArrayPropertyBoxed] ( #arraypropertyboxed )
184
+
185
+ record that stores validated List payloads, sealed permits implementation
186
+
187
+ ### Constructor Summary
188
+ | Constructor and Description |
189
+ | --------------------------- |
190
+ | ArrayPropertyBoxedList([ ArrayPropertyList] ( #arraypropertylist ) data)<br >Creates an instance, private visibility |
191
+
192
+ ### Method Summary
193
+ | Modifier and Type | Method and Description |
194
+ | ----------------- | ---------------------- |
195
+ | [ ArrayPropertyList] ( #arraypropertylist ) | data()<br >validated payload |
196
+ | @Nullable Object | getData()<br >validated payload |
197
+
198
+ ## ArrayProperty
199
+ public static class ArrayProperty<br >
200
+ extends JsonSchema
201
+
202
+ A schema class that validates payloads
203
+
204
+ ### Code Sample
205
+ ```
206
+ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags;
207
+ import org.openapijsonschematools.client.configurations.SchemaConfiguration;
208
+ import org.openapijsonschematools.client.exceptions.ValidationException;
209
+ import org.openapijsonschematools.client.schemas.validation.MapUtils;
210
+ import org.openapijsonschematools.client.schemas.validation.FrozenList;
211
+ import org.openapijsonschematools.client.schemas.validation.FrozenMap;
212
+ import org.openapijsonschematools.client.components.schemas.ObjectWithOnlyOptionalProps;
213
+
214
+ import java.util.Arrays;
215
+ import java.util.List;
216
+ import java.util.AbstractMap;
217
+
218
+ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());
219
+
220
+ // null validation
221
+ Void validatedPayload = ObjectWithOnlyOptionalProps.ArrayProperty.validate(
222
+ (Void) null,
223
+ configuration
224
+ );
225
+
226
+ // List validation
227
+ ObjectWithOnlyOptionalProps.ArrayPropertyList validatedPayload =
228
+ ObjectWithOnlyOptionalProps.ArrayProperty.validate(
229
+ new ObjectWithOnlyOptionalProps.ArrayPropertyListBuilder()
230
+ .add("_abc")
231
+
232
+ .build(),
233
+ configuration
234
+ );
235
+ ```
236
+
237
+ ### Field Summary
238
+ | Modifier and Type | Field and Description |
239
+ | ----------------- | ---------------------- |
240
+ | Set<Class<?>> | type = Set.of(<br />  ;  ;  ;  ; Void.class,<br />  ;  ;  ;  ; List.class<br />)<br /> |
241
+ | Class<? extends JsonSchema> | items = [ EnumClass.EnumClass1.class] ( ../../components/schemas/EnumClass.md#enumclass1 ) |
242
+
243
+ ### Method Summary
244
+ | Modifier and Type | Method and Description |
245
+ | ----------------- | ---------------------- |
246
+ | Void | validate(Void arg, SchemaConfiguration configuration) |
247
+ | [ ArrayPropertyBoxedVoid] ( #arraypropertyboxedvoid ) | validateAndBox(Void arg, SchemaConfiguration configuration) |
248
+ | [ ArrayPropertyList] ( #arraypropertylist ) | validate([ List<?>] ( #arraypropertylistbuilder ) arg, SchemaConfiguration configuration) |
249
+ | [ ArrayPropertyBoxedList] ( #arraypropertyboxedlist ) | validateAndBox([ List<?>] ( #arraypropertylistbuilder ) arg, SchemaConfiguration configuration) |
250
+ | [ ArrayPropertyBoxed] ( #arraypropertyboxed ) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) |
251
+ | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) |
252
+
253
+ ## ArrayPropertyListBuilder
254
+ public class ArrayPropertyListBuilder<br >
255
+ builder for ` List<String> `
256
+
257
+ A class that builds the List input type
258
+
259
+ ### Constructor Summary
260
+ | Constructor and Description |
261
+ | --------------------------- |
262
+ | ArrayPropertyListBuilder()<br >Creates an empty list |
263
+ | ArrayPropertyListBuilder(List<String > items)<br >Stores the items in a list |
264
+
265
+ ### Method Summary
266
+ | Modifier and Type | Method and Description |
267
+ | ----------------- | ---------------------- |
268
+ | ArrayPropertyListBuilder | add(String item) |
269
+ | ArrayPropertyListBuilder | add([ EnumClass.StringEnumClassEnums] ( ../../components/schemas/EnumClass.md#stringenumclassenums ) item) |
270
+ | List<String > | build()<br >Returns list input that should be used with Schema.validate |
271
+
272
+ ## ArrayPropertyList
273
+ public class ArrayPropertyList<br >
274
+ extends ` FrozenList<String> `
275
+
276
+ A class to store validated List payloads
277
+
278
+ ### Method Summary
279
+ | Modifier and Type | Method and Description |
280
+ | ----------------- | ---------------------- |
281
+ | static [ ArrayPropertyList] ( #arraypropertylist ) | of([ List<String >] ( #arraypropertylistbuilder ) arg, SchemaConfiguration configuration) |
142
282
143
283
## BBoxed
144
284
public sealed interface BBoxed<br >
0 commit comments