Skip to content

Commit

Permalink
Allow sending empty "Messages" via the OpenAPI documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Fendt <Florian.Fendt@bosch.io>
  • Loading branch information
ffendt committed Nov 6, 2020
1 parent a7609ec commit f1e8bdd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 10 deletions.
23 changes: 18 additions & 5 deletions documentation/src/main/resources/openapi/ditto-api-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2024,7 +2024,9 @@ paths:
'503':
$ref: '#/components/responses/messageTimeout'
requestBody:
$ref: '#/components/requestBodies/Payload'
allOf:
- $ref: '#/components/requestBodies/Payload'
- $ref: '#/components/requestBodies/EmptyPayload'
/things/{thingId}/inbox/messages/{messageSubject}:
post:
summary: Send a message TO a specific Thing.
Expand Down Expand Up @@ -2098,7 +2100,9 @@ paths:
'503':
$ref: '#/components/responses/messageTimeout'
requestBody:
$ref: '#/components/requestBodies/Payload'
allOf:
- $ref: '#/components/requestBodies/Payload'
- $ref: '#/components/requestBodies/EmptyPayload'
/things/{thingId}/outbox/messages/{messageSubject}:
post:
summary: Send a message FROM a specific Thing.
Expand Down Expand Up @@ -2171,7 +2175,9 @@ paths:
'503':
$ref: '#/components/responses/messageTimeout'
requestBody:
$ref: '#/components/requestBodies/Payload'
allOf:
- $ref: '#/components/requestBodies/Payload'
- $ref: '#/components/requestBodies/EmptyPayload'
/things/{thingId}/features/{featureId}/inbox/messages/{messageSubject}:
post:
summary: Send a message TO a specific Feature of a specific Thing.
Expand Down Expand Up @@ -2245,7 +2251,9 @@ paths:
'503':
$ref: '#/components/responses/messageTimeout'
requestBody:
$ref: '#/components/requestBodies/Payload'
allOf:
- $ref: '#/components/requestBodies/Payload'
- $ref: '#/components/requestBodies/EmptyPayload'
/things/{thingId}/features/{featureId}/outbox/messages/{messageSubject}:
post:
summary: Send a message FROM a specific Feature of a specific Thing.
Expand Down Expand Up @@ -2319,7 +2327,9 @@ paths:
'503':
$ref: '#/components/responses/messageTimeout'
requestBody:
$ref: '#/components/requestBodies/Payload'
allOf:
- $ref: '#/components/requestBodies/Payload'
- $ref: '#/components/requestBodies/EmptyPayload'
/search/things:
get:
summary: Search for Things
Expand Down Expand Up @@ -2516,6 +2526,9 @@ components:
description: |-
Payload of the message with max size of 250 kB. It can be any HTTP
supported content, including binary content.
EmptyPayload:
content:
none/none: {}
Value:
content:
application/json:
Expand Down
24 changes: 19 additions & 5 deletions documentation/src/main/resources/openapi/ditto-api-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2523,7 +2523,9 @@ paths:
'503':
$ref: '#/components/responses/messageTimeout'
requestBody:
$ref: '#/components/requestBodies/Payload'
allOf:
- $ref: '#/components/requestBodies/Payload'
- $ref: '#/components/requestBodies/EmptyPayload'
'/things/{thingId}/inbox/messages/{messageSubject}':
post:
summary: Send a message TO a specific thing
Expand Down Expand Up @@ -2617,7 +2619,9 @@ paths:
'503':
$ref: '#/components/responses/messageTimeout'
requestBody:
$ref: '#/components/requestBodies/Payload'
allOf:
- $ref: '#/components/requestBodies/Payload'
- $ref: '#/components/requestBodies/EmptyPayload'
'/things/{thingId}/outbox/messages/{messageSubject}':
post:
summary: Send a message FROM a specific thing
Expand Down Expand Up @@ -2697,7 +2701,9 @@ paths:
'503':
$ref: '#/components/responses/messageTimeout'
requestBody:
$ref: '#/components/requestBodies/Payload'
allOf:
- $ref: '#/components/requestBodies/Payload'
- $ref: '#/components/requestBodies/EmptyPayload'
'/things/{thingId}/features/{featureId}/inbox/messages/{messageSubject}':
post:
summary: Send a message TO a specific feature of a specific thing
Expand Down Expand Up @@ -2781,7 +2787,9 @@ paths:
'503':
$ref: '#/components/responses/messageTimeout'
requestBody:
$ref: '#/components/requestBodies/Payload'
allOf:
- $ref: '#/components/requestBodies/Payload'
- $ref: '#/components/requestBodies/EmptyPayload'
'/things/{thingId}/features/{featureId}/outbox/messages/{messageSubject}':
post:
summary: Send a message FROM a specific feature of a specific thing
Expand Down Expand Up @@ -2863,7 +2871,9 @@ paths:
'503':
$ref: '#/components/responses/messageTimeout'
requestBody:
$ref: '#/components/requestBodies/Payload'
allOf:
- $ref: '#/components/requestBodies/Payload'
- $ref: '#/components/requestBodies/EmptyPayload'
###
### Policies
###
Expand Down Expand Up @@ -5364,6 +5374,10 @@ components:
Payload of the message with max size of 250 kB. It can be any HTTP
supported content, including binary content.
EmptyPayload:
content:
none/none: {}

Definition:
content:
application/json:
Expand Down

0 comments on commit f1e8bdd

Please sign in to comment.