Run FastApizr with a JSON, which includes a function with a Callable annotation without specific arguments.
Observe the error logs produced.
Actual Result
FastApizr throws a "list index out of range" error when attempting to analyze the Callable annotation without specific arguments.
Expected Result
FastApizr should correctly handle the Callable annotation even when no specific arguments are provided. If specific arguments are required, a more descriptive error or warning should be produced.
Additional context
The error seems to originate from the get_annotation_fields method within modelGenerator.py when accessing annotation.of[0] without prior length-checking of annotation.of. This suggests that the code doesn't properly handle Callable annotations without specific arguments.
Bug Report
Steps to reproduce
Callable
annotation without specific arguments.Actual Result
FastApizr throws a "list index out of range" error when attempting to analyze the
Callable
annotation without specific arguments.Expected Result
FastApizr should correctly handle the
Callable
annotation even when no specific arguments are provided. If specific arguments are required, a more descriptive error or warning should be produced.Additional context
The error seems to originate from the
get_annotation_fields
method withinmodelGenerator.py
when accessingannotation.of[0]
without prior length-checking ofannotation.of
. This suggests that the code doesn't properly handleCallable
annotations without specific arguments.