diff --git a/AUTHORS b/AUTHORS index 543274a8..500dc3c6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -31,6 +31,7 @@ Raphael Cohen René Kälin Roberto Barreda Rohith PR +Safa AlFulaij santiavenda Sergey Kolomenkin Stas S. diff --git a/CHANGELOG.md b/CHANGELOG.md index c78a1b12..19b4ac01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ any parts of the framework not mentioned in the documentation should generally b ### Added * Added support for Django 3.2. +* Added support for tags in OAS schema ### Fixed diff --git a/example/tests/snapshots/snap_test_openapi.py b/example/tests/snapshots/snap_test_openapi.py index 7c0b3b98..f89fb442 100644 --- a/example/tests/snapshots/snap_test_openapi.py +++ b/example/tests/snapshots/snap_test_openapi.py @@ -121,7 +121,10 @@ }, "description": "not found" } - } + }, + "tags": [ + "authors" + ] }""" snapshots[ @@ -227,7 +230,10 @@ }, "description": "not found" } - } + }, + "tags": [ + "authors" + ] }""" snapshots[ @@ -411,7 +417,10 @@ }, "description": "[Conflict](https://jsonapi.org/format/#crud-creating-responses-409)" } - } + }, + "tags": [ + "authors" + ] }""" snapshots[ @@ -589,7 +598,10 @@ }, "description": "[Conflict]([Conflict](https://jsonapi.org/format/#crud-updating-responses-409)" } - } + }, + "tags": [ + "authors" + ] }""" snapshots[ @@ -652,5 +664,8 @@ }, "description": "[Resource does not exist](https://jsonapi.org/format/#crud-deleting-responses-404)" } - } + }, + "tags": [ + "authors" + ] }""" diff --git a/rest_framework_json_api/schemas/openapi.py b/rest_framework_json_api/schemas/openapi.py index b51f366f..77a0d4ed 100644 --- a/rest_framework_json_api/schemas/openapi.py +++ b/rest_framework_json_api/schemas/openapi.py @@ -427,6 +427,7 @@ def get_operation(self, path, method): parameters += self.get_pagination_parameters(path, method) parameters += self.get_filter_parameters(path, method) operation["parameters"] = parameters + operation["tags"] = self.get_tags(path, method) # get request and response code schemas if method == "GET":