如何在 Django REST Swagger 中隐藏 Response Class?
How does one hide the Response Class in Django REST Swagger?
我试图从我通过 Django REST Swagger 编写的 API 文档中隐藏响应 Class(模型和模型架构)。
我想也许我可以设置 @APIModelProperty(hidden=true)
- 但运气不好。我似乎也无法在 Django REST Swagger docs 中找到任何内容。
有什么想法吗?谢谢
您可以使用 YAML Docstring:
http://django-rest-swagger.readthedocs.io/en/latest/yaml.html
使用参数omit_serializer:
"""
Method description here
---
omit_serializer: true
"""
我试图从我通过 Django REST Swagger 编写的 API 文档中隐藏响应 Class(模型和模型架构)。
我想也许我可以设置 @APIModelProperty(hidden=true)
- 但运气不好。我似乎也无法在 Django REST Swagger docs 中找到任何内容。
有什么想法吗?谢谢
您可以使用 YAML Docstring: http://django-rest-swagger.readthedocs.io/en/latest/yaml.html
使用参数omit_serializer:
"""
Method description here
---
omit_serializer: true
"""