From 631697414693cc69835ec5faf5a58bb3d44c08da Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 5 Sep 2023 11:38:08 +1000 Subject: [PATCH] Group DFC API operations by endpoint Previously they were all in one long list called "default". --- spec/base_spec_helper.rb | 4 ++++ swagger/dfc-v1.7/swagger.yaml | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/spec/base_spec_helper.rb b/spec/base_spec_helper.rb index 7c7af2dc88..06d521b45c 100644 --- a/spec/base_spec_helper.rb +++ b/spec/base_spec_helper.rb @@ -102,8 +102,12 @@ RSpec.configure do |config| # Take example responses from Rswag specs for API documentation. # https://github.com/rswag/rswag#enable-auto-generation-examples-from-responses config.after(:each, :rswag_autodoc) do |example| + # Categories and group operations of the same API endpoint. + example.metadata[:operation][:tags] ||= [self.class.top_level_description] + next if response&.body.blank? + # Include response as example in the documentation. example.metadata[:response][:content] ||= {} example.metadata[:response][:content].deep_merge!( { diff --git a/swagger/dfc-v1.7/swagger.yaml b/swagger/dfc-v1.7/swagger.yaml index 431be36edb..197abe88f7 100644 --- a/swagger/dfc-v1.7/swagger.yaml +++ b/swagger/dfc-v1.7/swagger.yaml @@ -47,6 +47,8 @@ paths: required: true schema: type: string + tags: + - Addresses responses: '200': description: successful @@ -73,6 +75,8 @@ paths: type: string get: summary: List CatalogItems + tags: + - CatalogItems responses: '404': description: not found @@ -134,6 +138,8 @@ paths: type: string get: summary: Show CatalogItem + tags: + - CatalogItems responses: '200': description: success @@ -159,6 +165,8 @@ paths: put: summary: Update CatalogItem parameters: [] + tags: + - CatalogItems responses: '204': description: no content @@ -235,6 +243,8 @@ paths: required: true schema: type: string + tags: + - Enterprises responses: '200': description: successful @@ -289,6 +299,8 @@ paths: required: true schema: type: string + tags: + - Persons responses: '200': description: successful @@ -312,6 +324,8 @@ paths: post: summary: Create SuppliedProduct parameters: [] + tags: + - SuppliedProducts responses: '400': description: bad request @@ -374,6 +388,8 @@ paths: type: string get: summary: Show SuppliedProduct + tags: + - SuppliedProducts responses: '200': description: success @@ -401,6 +417,8 @@ paths: put: summary: Update SuppliedProduct parameters: [] + tags: + - SuppliedProducts responses: '401': description: unauthorized