From 4d3eecb282957c7e37517385c37c3cfe55d72913 Mon Sep 17 00:00:00 2001 From: Safa Alfulaij Date: Mon, 19 Apr 2021 17:14:25 +0300 Subject: [PATCH 1/4] Suuport openapi tags --- rest_framework_json_api/schemas/openapi.py | 1 + 1 file changed, 1 insertion(+) 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": From ed81060f32b52dd1a9068c6dc4cc99bba55168e1 Mon Sep 17 00:00:00 2001 From: Safa Alfulaij Date: Mon, 19 Apr 2021 22:24:28 +0300 Subject: [PATCH 2/4] Update openapi tests --- example/tests/snapshots/snap_test_openapi.py | 25 ++++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) 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" + ] }""" From c8576d11bd0046e59f7df0a649e70a9bc86f2f5d Mon Sep 17 00:00:00 2001 From: Oliver Sauder Date: Tue, 20 Apr 2021 14:20:12 +0400 Subject: [PATCH 3/4] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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 From f227200de72962aa7ad14bc66abea25b5e45f8c0 Mon Sep 17 00:00:00 2001 From: Safa AlFulaij Date: Tue, 20 Apr 2021 17:20:33 +0300 Subject: [PATCH 4/4] Update AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) 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.