![]() ![]() If we use this annotation directly, it will not be parsed by Swagger. We should use the annotations within the annotation, whether we have one or multiple responses. For example: from restframework.views import. ![]() There was a bug related to the file type that was recently resolved. Additionally, a number of attributes may be set on the class that control various aspects of the API policy. Also, make sure to use produces: application/pdf If it fails for you, make sure you use the latest version of the editor. ![]() In the Swagger 2.0 specification, the notion of tags was created and made a more flexible grouping mechanism. Out of the options you gave, thats the right option. The reason why its deprecated is that previous Swagger versions (1.x) used the Api description annotation to group operations. In other words, the method annotations have precedence over class annotations. responses: 200: description: Returns PDF schema: type: file. Moreover, annotation put on the class level will be parsed only if an annotation with the same code is not already defined on the method level. While the annotation describes an operation and a general return type, the annotation describes the rest of the possible return codes.įurthermore, the annotation can be applied at the method level as well as at the class level. An operation is considered a unique combination of a path and a HTTP method. We can use the annotation to describe the concrete possible response of an operation. The ApiOperation is used to declare a single operation within an API resource. It's a common practice to return errors using HTTP status codes. ![]()
0 Comments
Leave a Reply. |