weixin_39930671 2020-11-30 06:44
浏览 0

What is the easiest way to add a description to a response openapi.Schema on a particular operation

Viewset has lots of different retrieve operations, each containing a subset of the possible information. The operation description is easily customized, but not the response description.

该提问来源于开源项目:axnsan12/drf-yasg

  • 写回答

5条回答 默认 最新

  • weixin_39930671 2020-11-30 06:44
    关注

    Answering my own question, the default behiavor section of the documentation is clear that the description of each response is left blank. This won't fly in OAI 3, but even AWS API Gateway is not there yet.

    If someone, such as myself, wants to pass an argument such as "response_description", or something like that, it is clear that this must be done by using a custom drf_yasg.inspectors.SwaggerAutoSchema and teaching it what to do.

    评论

报告相同问题?