4242 num_requests => pos_integer (),
4343 retries => non_neg_integer (),
4444 retry_interval => non_neg_integer (),
45+ max_string_length => pos_integer (),
46+ max_array_items => non_neg_integer (),
4547 output_fun => restcheck_pbt :output_fun ()
4648}.
4749-type test_result () :: {OperationId :: binary (), Result :: ok | {error , Reason :: term ()}}.
@@ -99,6 +101,8 @@ init(State) ->
99101 " {num_requests, pos_integer()} % number of requests per operation, defaults to 5000\n "
100102 " {retries, non_neg_integer()} % retries when the server is unreachable, defaults to 0\n "
101103 " {retry_interval, non_neg_integer()} % wait between retries in ms, defaults to 100\n "
104+ " {max_string_length, pos_integer()} % default max length for strings without maxLength, defaults to 255\n "
105+ " {max_array_items, non_neg_integer()} % default max items for arrays without maxItems, defaults to 3\n "
102106 " {log_file, string()} % path to file where timestamped events are logged, disabled if no path is provided\n "
103107 " ]}." }
104108 ]),
@@ -125,6 +129,8 @@ do(State) ->
125129 num_requests => proplists :get_value (num_requests , RawConf , 100 ),
126130 retries => proplists :get_value (retries , RawConf , 0 ),
127131 retry_interval => proplists :get_value (retry_interval , RawConf , 100 ),
132+ max_string_length => proplists :get_value (max_string_length , RawConf , 255 ),
133+ max_array_items => proplists :get_value (max_array_items , RawConf , 3 ),
128134 auth => proplists :get_value (auth , RawConf , undefined )
129135 },
130136 LogFile = proplists :get_value (log_file , RawConf , undefined ),
@@ -356,7 +362,7 @@ file_log(LogFile, Format, Args) ->
356362 Reason :: term ().
357363generate_and_load_suite (Conf ) ->
358364 SpecPath = maps :get (spec_path , Conf ),
359- SpecParser = maps :get (spec_format , Conf , erf_parser_oas_3_0 ),
365+ SpecParser = maps :get (spec_parser , Conf , erf_parser_oas_3_0 ),
360366 case erf_parser :parse (SpecPath , SpecParser ) of
361367 {ok , API } ->
362368 APIName = maps :get (name , API ),
@@ -367,9 +373,14 @@ generate_and_load_suite(Conf) ->
367373 auth => maps :get (auth , Conf , undefined ),
368374 timeout => maps :get (timeout , Conf , 5000 )
369375 },
376+ GenerationOpts = #{
377+ recursion_max_depth => 5 ,
378+ max_string_length => maps :get (max_string_length , Conf , 255 ),
379+ max_array_items => maps :get (max_array_items , Conf , 3 )
380+ },
370381 DTOs = maps :get (schemas , API , []),
371382 load_dtos (maps :to_list (DTOs )),
372- {SuiteName , Suite } = restcheck_suite :generate (API ),
383+ {SuiteName , Suite } = restcheck_suite :generate (API , GenerationOpts ),
373384 ok = restcheck_suite :load (Suite ),
374385 Tests = lists :flatmap (
375386 fun (Endpoint ) ->
0 commit comments