File tree 1 file changed +37
-0
lines changed
modules/swagger-java17-support/src/test/java/io/swagger/v3/java17/resolving
1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -80,4 +80,41 @@ public record JavaRecordClassWithBeanValidation(
80
80
){
81
81
}
82
82
83
+ @ Test
84
+ public void testJavaRecordWithBeanValidationSizeTypeUse () {
85
+ String expectedYaml = "JavaRecordWithAnnotationsOnGenericType:\n " +
86
+ " type: object\n " +
87
+ " properties:\n " +
88
+ " randomList:\n " +
89
+ " maxItems: 10000\n " +
90
+ " minItems: 100\n " +
91
+ " type: array\n " +
92
+ " items:\n " +
93
+ " maxLength: 10\n " +
94
+ " minLength: 1\n " +
95
+ " type: string\n " +
96
+ " secondList:\n " +
97
+ " type: array\n " +
98
+ " items:\n " +
99
+ " pattern: (.+?)@(.+?)\n " +
100
+ " type: string\n " +
101
+ " id:\n " +
102
+ " type: array\n " +
103
+ " items:\n " +
104
+ " maximum: 10000\n " +
105
+ " minimum: 1\n " +
106
+ " type: integer\n " +
107
+ " format: int32" ;
108
+
109
+ Map <String , Schema > stringSchemaMap = ModelConverters .getInstance (false ).readAll (JavaRecordWithAnnotationsOnGenericType .class );
110
+ SerializationMatchers .assertEqualsToYaml (stringSchemaMap , expectedYaml );
111
+ }
112
+
113
+ public record JavaRecordWithAnnotationsOnGenericType (
114
+ @ Size (min = 100 , max = 10000 )
115
+ List <@ Size (min = 1 , max = 10 ) String > randomList ,
116
+ List <@ Pattern (regexp = "(.+?)@(.+?)" ) String > secondList ,
117
+ List <@ Min (1 )@ Max (10000 ) Integer > id
118
+ ){
119
+ }
83
120
}
You can’t perform that action at this time.
0 commit comments