mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Group DFC API operations by endpoint
Previously they were all in one long list called "default".
This commit is contained in:
@@ -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!(
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user