Skip to content

Commit 5e4d320

Browse files
committed
Better error examples
1 parent 91fc667 commit 5e4d320

File tree

3 files changed

+71
-79
lines changed

3 files changed

+71
-79
lines changed

EditorsDraft/edit.html

+5-4
Original file line numberDiff line numberDiff line change
@@ -1162,15 +1162,16 @@
11621162

11631163
If there are any issues with the `orderedItem`s provided in the `OrderQuote`, the <a>Booking System</a> MUST respond with a `409 Conflict` response, with `error` details provided against each offending `OrderItem`. Note that `totalPaymentDue` and `totalTaxSpecification` MUST be calculated excluding any `OrderItem`s that include `error`s.
11641164

1165-
<pre class="example" title="Order Creation: OrderQuote example failure response" data-transform="dataExampleOrderQuoteCreationErrorResponse">
1165+
<pre class="example" title="Order Creation: OrderQuote example OrderItem error response" data-transform="dataExampleOrderQuoteCreationOrderItemErrorResponse">
11661166
</pre>
11671167

11681168
If there are issues with other properties of the `OrderQuote` outside of `orderedItem`, the <a>Booking System</a> MUST respond with a JSON-LD response which includes only the appropriate `OpenBookingError` and the appropriate status code.
11691169

1170-
<pre class="example" title="Order Creation: OrderQuote example failure response" data-transform="dataExampleOrderQuoteCreationGenericErrorResponse">
1170+
<pre class="example" title="Order Creation: OrderQuote example failure response" data-transform="dataExampleOrderQuoteCreationErrorResponse">
11711171
</pre>
11721172

11731173

1174+
11741175
#### `Order`
11751176

11761177
A PUT request to the Order Creation endpoint of the <a>Booking System</a> with an object of type `Order` will create the `Order` and complete the booking from the point of the view of the <a>Booking System</a>.
@@ -1722,8 +1723,8 @@
17221723
5XX status code specified in the model.
17231724

17241725
All error responses from this API MUST be returned in a JSON-LD format using a
1725-
content type of `application/vnd.openactive+json` and include at least one
1726-
`OpenBookingError` object.
1726+
content type of `application/vnd.openactive+json`, and optionally any version
1727+
parameters, and include at least one `OpenBookingError` object.
17271728

17281729
<pre class="example" title="Error response format">
17291730
{

EditorsDraft/examples.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function dataExampleOrderQuoteCreationResponse(utils, content) {
3131
});
3232
}
3333

34-
function dataExampleOrderQuoteCreationErrorResponse(utils, content) {
34+
function dataExampleOrderQuoteCreationOrderItemErrorResponse(utils, content) {
3535
return generateResponse("409 Conflict", null, OPERATIONS_MEDIA_TYPE, {
3636
"@context": CONTEXT,
3737
"type": "OrderQuote",
@@ -45,7 +45,7 @@ function dataExampleOrderQuoteCreationErrorResponse(utils, content) {
4545
});
4646
}
4747

48-
function dataExampleOrderQuoteCreationGenericErrorResponse(utils, content) {
48+
function dataExampleOrderQuoteCreationErrorResponse(utils, content) {
4949
return generateResponse("400 Bad Request", null, OPERATIONS_MEDIA_TYPE, {
5050
"@context": CONTEXT,
5151
"type": "IncompleteCustomerDetailsError",

0 commit comments

Comments
 (0)