Skip to content

Commit

Permalink
Fix the response format of the /send endpoint
Browse files Browse the repository at this point in the history
Fixes #2236
  • Loading branch information
turt2live committed May 20, 2020
1 parent 3875d50 commit 74b627a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 37 deletions.
64 changes: 27 additions & 37 deletions api/server-server/transactions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,43 +77,33 @@ paths:
The result of processing the transaction. The server is to use this response even in
the event of one or more PDUs failing to be processed.
schema:
type: array
minItems: 2
maxItems: 2
items:
- type: integer
description: The value ``200``.
example: 200
- type: object
title: PDU Processing Results
description: The results for the processing of each PDU in the transaction.
properties:
pdus:
type: object
description: |-
The PDUs from the original transaction. The string key represents the ID of the
PDU (event) that was processed.
additionalProperties:
type: object
title: PDU Processing Result
description: Information about how the PDU was handled.
properties:
error:
type: string
description: |-
A human readable description about what went wrong in processing this PDU.
If no error is present, the PDU can be considered successfully handled.
example: "You are not allowed to send a message to this room."
required: ['pdus']
type: object
title: PDU Processing Results
description: The results for the processing of each PDU in the transaction.
properties:
pdus:
type: object
description: |-
The PDUs from the original transaction. The string key represents the ID of the
PDU (event) that was processed.
additionalProperties:
type: object
title: PDU Processing Result
description: Information about how the PDU was handled.
properties:
error:
type: string
description: |-
A human readable description about what went wrong in processing this PDU.
If no error is present, the PDU can be considered successfully handled.
example: "You are not allowed to send a message to this room."
required: ['pdus']
examples:
application/json: [
200,
{
"pdus": {
"$successful_event:example.org": {},
"$failed_event:example.org": {
"error": "You are not allowed to send a message to this room."
}
application/json: {
"pdus": {
"$successful_event:example.org": {},
"$failed_event:example.org": {
"error": "You are not allowed to send a message to this room."
}
}
]
}
1 change: 1 addition & 0 deletions changelogs/server_server/newsfragments/2560.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the response format of the ``/send`` endpoint.

0 comments on commit 74b627a

Please sign in to comment.