You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use flask-accepts (marshmallow+flask-restx) to document and marshal our API. We would like to use the same tools to validate our custom JSON headers, but currently these extra models can't appear in the generated documentation because they are not a payload on any of our API endpoints.
Possible solution:
Add this bit of code to Swagger.as_dict() in flask_restx/swagger.py:
# should_add_unused_models could come from a RESTX_INCLUDE_ALL_MODELS env var, default is Falseifshould_add_unused_models:
forminself.api.models:
self.register_model(m)
If you feel this request is reasonable, I would be happy to contribute a PR.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi,
We use
flask-accepts
(marshmallow
+flask-restx
) to document and marshal our API. We would like to use the same tools to validate our custom JSON headers, but currently these extra models can't appear in the generated documentation because they are not a payload on any of our API endpoints.Possible solution:
Add this bit of code to
Swagger.as_dict()
inflask_restx/swagger.py
:If you feel this request is reasonable, I would be happy to contribute a PR.
Thanks!
The text was updated successfully, but these errors were encountered: