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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 10 additions & 10 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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
```

0 commit comments

Comments
 (0)