Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit d3876c8

Browse files
authored
Java, schema documentation improvements for strings (#322)
* Adds examples for date, date-time, number * Adds pattern example generation * Pattern code fixed * Sample template updated * Fixes java tests
1 parent d40e1cf commit d3876c8

File tree

23 files changed

+137
-184
lines changed

23 files changed

+137
-184
lines changed

samples/client/petstore/java/docs/components/schemas/Apple.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ Apple.AppleMap validatedPayload =
4545
MapMaker.makeMap(
4646
new AbstractMap.SimpleEntry<>(
4747
"cultivar",
48-
"a"
48+
"IaQnEaqioxT oASzjxaSH"
4949
),
5050
new AbstractMap.SimpleEntry<>(
5151
"origin",
52-
"a"
52+
"IaQnEaqioxT oASzjxaSH"
5353
)
5454
),
5555
configuration
@@ -114,7 +114,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
114114
115115
// String validation
116116
String validatedPayload = Apple.Origin.validate(
117-
"a",
117+
"IaQnEaqioxT oASzjxaSH",
118118
configuration
119119
);
120120
```
@@ -152,7 +152,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
152152
153153
// String validation
154154
String validatedPayload = Apple.Cultivar.validate(
155-
"a",
155+
"IaQnEaqioxT oASzjxaSH",
156156
configuration
157157
);
158158
```

samples/client/petstore/java/docs/components/schemas/ComposedOneOfDifferentTypes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
6666
6767
// String validation
6868
String validatedPayload = ComposedOneOfDifferentTypes.Schema6.validate(
69-
"a",
69+
"2020jUR,rZ#UM/?R,Fp^l6$ARj",
7070
configuration
7171
);
7272
```

samples/client/petstore/java/docs/components/schemas/DateTimeTest.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
3232
3333
// String validation
3434
String validatedPayload = DateTimeTest.DateTimeTest1.validate(
35-
"a",
35+
"1970-01-01T00:00:00.00Z",
3636
configuration
3737
);
3838
```

samples/client/petstore/java/docs/components/schemas/DateTimeWithValidations.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
3232
3333
// String validation
3434
String validatedPayload = DateTimeWithValidations.DateTimeWithValidations1.validate(
35-
"a",
35+
"2020jUR,rZ#UM/?R,Fp^l6$ARj",
3636
configuration
3737
);
3838
```

samples/client/petstore/java/docs/components/schemas/DateWithValidations.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
3232
3333
// String validation
3434
String validatedPayload = DateWithValidations.DateWithValidations1.validate(
35-
"a",
35+
"2020jUR,rZ#UM/?R,Fp^l6$ARj",
3636
configuration
3737
);
3838
```

samples/client/petstore/java/docs/components/schemas/FormatTest.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ FormatTest.FormatTestMap validatedPayload =
6464
),
6565
new AbstractMap.SimpleEntry<>(
6666
"date",
67-
"a"
67+
"2020-12-13"
6868
),
6969
new AbstractMap.SimpleEntry<>(
7070
"number",
@@ -114,31 +114,31 @@ FormatTest.FormatTestMap validatedPayload =
114114
),
115115
new AbstractMap.SimpleEntry<>(
116116
"string",
117-
"a"
117+
"A"
118118
),
119119
new AbstractMap.SimpleEntry<>(
120120
"binary",
121121
"a"
122122
),
123123
new AbstractMap.SimpleEntry<>(
124124
"dateTime",
125-
"a"
125+
"1970-01-01T00:00:00.00Z"
126126
),
127127
new AbstractMap.SimpleEntry<>(
128128
"uuid",
129-
"a"
129+
"046b6c7f-0b8a-43b9-b35d-6489e6daee91"
130130
),
131131
new AbstractMap.SimpleEntry<>(
132132
"uuidNoExample",
133-
"a"
133+
"046b6c7f-0b8a-43b9-b35d-6489e6daee91"
134134
),
135135
new AbstractMap.SimpleEntry<>(
136136
"pattern_with_digits",
137-
"a"
137+
"0480728880"
138138
),
139139
new AbstractMap.SimpleEntry<>(
140140
"pattern_with_digits_and_delimiter",
141-
"a"
141+
"IMage_88"
142142
),
143143
new AbstractMap.SimpleEntry<>(
144144
"noneProp",
@@ -251,7 +251,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
251251
252252
// String validation
253253
String validatedPayload = FormatTest.PatternWithDigitsAndDelimiter.validate(
254-
"a",
254+
"IMage_88",
255255
configuration
256256
);
257257
```
@@ -292,7 +292,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
292292
293293
// String validation
294294
String validatedPayload = FormatTest.PatternWithDigits.validate(
295-
"a",
295+
"0480728880",
296296
configuration
297297
);
298298
```
@@ -420,7 +420,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
420420
421421
// String validation
422422
String validatedPayload = FormatTest.StringSchema.validate(
423-
"a",
423+
"A",
424424
configuration
425425
);
426426
```

samples/client/petstore/java/docs/components/schemas/MixedPropertiesAndAdditionalPropertiesClass.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ MixedPropertiesAndAdditionalPropertiesClass.MixedPropertiesAndAdditionalProperti
4141
MapMaker.makeMap(
4242
new AbstractMap.SimpleEntry<>(
4343
"uuid",
44-
"a"
44+
"046b6c7f-0b8a-43b9-b35d-6489e6daee91"
4545
),
4646
new AbstractMap.SimpleEntry<>(
4747
"dateTime",
48-
"a"
48+
"1970-01-01T00:00:00.00Z"
4949
),
5050
new AbstractMap.SimpleEntry<>(
5151
"map",

samples/client/petstore/java/docs/components/schemas/Money.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Money.MoneyMap validatedPayload =
3939
MapMaker.makeMap(
4040
new AbstractMap.SimpleEntry<>(
4141
"amount",
42-
"a"
42+
"3.14"
4343
),
4444
new AbstractMap.SimpleEntry<>(
4545
"currency",

samples/client/petstore/java/docs/components/schemas/MyObjectDto.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ MyObjectDto.MyObjectDtoMap validatedPayload =
3939
MapMaker.makeMap(
4040
new AbstractMap.SimpleEntry<>(
4141
"id",
42-
"a"
42+
"046b6c7f-0b8a-43b9-b35d-6489e6daee91"
4343
)
4444
),
4545
configuration

samples/client/petstore/java/docs/components/schemas/NullableClass.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ Void validatedPayload = NullableClass.DatetimeProp.validate(
762762
763763
// String validation
764764
String validatedPayload = NullableClass.DatetimeProp.validate(
765-
"a",
765+
"1970-01-01T00:00:00.00Z",
766766
configuration
767767
);
768768
```
@@ -807,7 +807,7 @@ Void validatedPayload = NullableClass.DateProp.validate(
807807
808808
// String validation
809809
String validatedPayload = NullableClass.DateProp.validate(
810-
"a",
810+
"2020-12-13",
811811
configuration
812812
);
813813
```

samples/client/petstore/java/docs/components/schemas/ObjectWithDecimalProperties.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ ObjectWithDecimalProperties.ObjectWithDecimalPropertiesMap validatedPayload =
3838
MapMaker.makeMap(
3939
new AbstractMap.SimpleEntry<>(
4040
"length",
41-
"a"
41+
"3.14"
4242
),
4343
new AbstractMap.SimpleEntry<>(
4444
"width",
45-
"a"
45+
"3.14"
4646
),
4747
new AbstractMap.SimpleEntry<>(
4848
"cost",
4949
MapMaker.makeMap(
5050
new AbstractMap.SimpleEntry<>(
5151
"amount",
52-
"a"
52+
"3.14"
5353
),
5454
new AbstractMap.SimpleEntry<>(
5555
"currency",

samples/client/petstore/java/docs/components/schemas/Order.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Order.OrderMap validatedPayload =
5555
),
5656
new AbstractMap.SimpleEntry<>(
5757
"shipDate",
58-
"a"
58+
"1970-01-01T00:00:00.00Z"
5959
),
6060
new AbstractMap.SimpleEntry<>(
6161
"status",

samples/client/petstore/java/docs/components/schemas/UUIDString.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
3232
3333
// String validation
3434
String validatedPayload = UUIDString.UUIDString1.validate(
35-
"a",
35+
"046b6c7f-0b8a-43b9-b35d-6489e6daee91",
3636
configuration
3737
);
3838
```

samples/client/petstore/java/docs/paths/fake/post/requestbody/content/applicationxwwwformurlencoded/Schema.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Schema.SchemaMap validatedPayload =
6363
),
6464
new AbstractMap.SimpleEntry<>(
6565
"pattern_without_delimiter",
66-
"a"
66+
"AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>"
6767
),
6868
new AbstractMap.SimpleEntry<>(
6969
"integer",
@@ -83,19 +83,19 @@ Schema.SchemaMap validatedPayload =
8383
),
8484
new AbstractMap.SimpleEntry<>(
8585
"string",
86-
"a"
86+
"A"
8787
),
8888
new AbstractMap.SimpleEntry<>(
8989
"binary",
9090
"a"
9191
),
9292
new AbstractMap.SimpleEntry<>(
9393
"date",
94-
"a"
94+
"2020-12-13"
9595
),
9696
new AbstractMap.SimpleEntry<>(
9797
"dateTime",
98-
"a"
98+
"1970-01-01T00:00:00.00Z"
9999
),
100100
new AbstractMap.SimpleEntry<>(
101101
"password",
@@ -243,7 +243,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
243243
244244
// String validation
245245
String validatedPayload = Schema.DateTime.validate(
246-
"a",
246+
"1970-01-01T00:00:00.00Z",
247247
configuration
248248
);
249249
```
@@ -315,7 +315,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
315315
316316
// String validation
317317
String validatedPayload = Schema.PatternWithoutDelimiter.validate(
318-
"a",
318+
"AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>",
319319
configuration
320320
);
321321
```
@@ -356,7 +356,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
356356
357357
// String validation
358358
String validatedPayload = Schema.StringSchema.validate(
359-
"a",
359+
"A",
360360
configuration
361361
);
362362
```

0 commit comments

Comments
 (0)