【问题标题】:How does one hide the Response Class in Django REST Swagger?如何在 Django REST Swagger 中隐藏响应类?
【发布时间】:2015-10-06 05:44:05
【问题描述】:

我试图从我通过 Django REST Swagger 编写的 API 文档中隐藏响应类(模型和模型架构)。

我想也许我可以设置@APIModelProperty(hidden=true) - 但没有运气。我似乎在Django REST Swagger docs 中也找不到任何东西。

有什么想法吗?谢谢。

【问题讨论】:

    标签: django django-rest-framework swagger


    【解决方案1】:

    您可以使用 YAML 文档字符串: http://django-rest-swagger.readthedocs.io/en/latest/yaml.html

    使用参数omit_serializer:

    """
    Method description here
    ---
    omit_serializer: true
    """
    

    【讨论】:

      猜你喜欢
      • 2019-02-24
      • 2022-07-21
      • 2019-03-15
      • 1970-01-01
      • 2017-03-03
      • 2018-12-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多