Open mkorycinski opened 2 years ago
I think the issue is that api.expect()
and namespace.expect()
expect you to pass a single expected model (or a list of the same expected model) or request parser? I can't exactly recreate the issue on my side for some reason.
My suggestion would be to document the authorizations separately, as described here: https://flask-restx.readthedocs.io/en/latest/swagger.html#documenting-authorizations
Then you can also build models that are composed of other models using fields.nested()
.
Hi,
I am developing an API with a POST method endpoint accepting:
Params are defined in the following way:
Model:
In the endpoint module:
Error Messages/Stack Trace
The error is raised by the following method from
flask_restx.swagger
:specifically:
It is raised since body parameter does not have
type
key. If I list here all_param variable it will be:Same error happens if I change the way I decorate endpoint class and method:
As I have started testing following modification to the 'faulty' code shall be enough as it allows to render schema and have documentation with all required parameters.
I will happily make a pull request if such a solution is good enough. However, perhaps this issue can be handled in another way.
Environment