Skip to content

Commit

Permalink
add GET /shipments/{shipment_id}/options specification
Browse files Browse the repository at this point in the history
  • Loading branch information
yoerriwalstra committed Feb 13, 2024
1 parent 9102a58 commit 9ee903e
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 17 deletions.
3 changes: 3 additions & 0 deletions specification/paths.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
"/shipments/{shipment_id}": {
"$ref": "./paths/Shipments-shipment_id.json"
},
"/shipments/{shipment_id}/options": {
"$ref": "./paths/Shipments-shipment_id-options.json"
},
"/shipments/{shipment_id}/statuses/{tracking_code}": {
"$ref": "./paths/Shipments-shipment_id-Statuses-tracking_code.json"
},
Expand Down
39 changes: 39 additions & 0 deletions specification/paths/Shipments-shipment_id-options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"get": {
"tags": [
"Shipments"
],
"summary": "Get all the service options for a shipment.",
"description": "This endpoint retrieves service options for the supplied shipment.",
"parameters": [
{
"$ref": "#/components/parameters/path-shipment_id"
}
],
"responses": {
"200": {
"description": "Retrieved the statuses.",
"content": {
"application/vnd.api+json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"description": "List of service options",
"type": "array",
"items": {
"$ref": "#/components/schemas/ServiceOption"
}
}
}
}
}
}
}
}
}
}
3 changes: 3 additions & 0 deletions specification/schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
"PriceAmount": {
"$ref": "./schemas/PriceAmount.json"
},
"ServiceOption": {
"$ref": "./schemas/ServiceOption.json"
},
"ServiceRate": {
"$ref": "./schemas/ServiceRate.json"
},
Expand Down
22 changes: 22 additions & 0 deletions specification/schemas/ServiceOption.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"type": "object",
"required": [
"code"
],
"properties": {
"code": {
"type": "string",
"example": "delivery-window:sunday"
},
"name": {
"type": "string",
"example": "Sunday Delivery"
},
"values": {
"type": "object",
"example": {
"pin": "1234"
}
}
}
}
18 changes: 1 addition & 17 deletions specification/schemas/Shipment.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,7 @@
"options": {
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "delivery-window:sunday"
},
"name": {
"type": "string",
"example": "Sunday Delivery"
},
"values": {
"type": "object",
"example": {
"pin": "1234"
}
}
}
"$ref": "#/components/schemas/ServiceOption"
}
},
"total_value": {
Expand Down

0 comments on commit 9ee903e

Please sign in to comment.