@@ -333,10 +333,21 @@ external_validators(_) ->
333333
334334
335335min_max_length (_ ) ->
336- {error , #{error := too_short }} =
336+ {error , #{error := too_short , detail : = 3 }} =
337337 openapi_schema :process (<<" 123" >>, #{schema => #{type => <<" string" >>, minLength => 5 }}),
338- {error , #{error := too_long }} =
338+ {error , #{error := too_long , detail : = 3 }} =
339339 openapi_schema :process (<<" 123" >>, #{schema => #{type => <<" string" >>, maxLength => 2 }}),
340+
341+ {error , #{error := too_short , detail := 4 }} =
342+ openapi_schema :process (atom , #{schema => #{type => <<" string" >>, minLength => 5 }}),
343+ {error , #{error := too_long , detail := 4 }} =
344+ openapi_schema :process (atom , #{schema => #{type => <<" string" >>, maxLength => 2 }}),
345+
346+ UTFString = unicode :characters_to_binary ([128578 ,128579 ]), % 2 code points, but 8 bytes
347+ {error , #{error := too_short , detail := 2 }} =
348+ openapi_schema :process (UTFString , #{schema => #{type => <<" string" >>, minLength => 3 }}),
349+ {error , #{error := too_long , detail := 2 }} =
350+ openapi_schema :process (UTFString , #{schema => #{type => <<" string" >>, maxLength => 1 }}),
340351 ok .
341352
342353
0 commit comments