From 892a28e3ae4ac47239ffeaa154e38bad403b56e4 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon <67381+philsturgeon@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:51:48 +0000 Subject: [PATCH] feat: add links to a trips stations --- openapi.yaml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index d3d7b78..1d55ca0 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -233,7 +233,10 @@ paths: data: type: array items: - $ref: '#/components/schemas/Trip' + allOf: + - $ref: '#/components/schemas/Trip' + - $ref: '#/components/schemas/Links-Origin' + - $ref: '#/components/schemas/Links-Destination' - properties: links: allOf: @@ -250,6 +253,10 @@ paths: operator: Deutsche Bahn bicycles_allowed: true dogs_allowed: true + links: + self: https://api.example.com/trips/ea399ba1-6d95-433f-92d1-83f67b775594 + origin: https://api.example.com/stations/efdbb9d1-02c2-4bc3-afb7-6788d8782b1e + destination: https://api.example.com/stations/b2e783e1-c824-4d63-b37a-d8d698862f1d - id: 4d67459c-af07-40bb-bb12-178dbb88e09f origin: b2e783e1-c824-4d63-b37a-d8d698862f1d destination: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e @@ -259,6 +266,10 @@ paths: operator: SNCF bicycles_allowed: true dogs_allowed: true + links: + self: https://api.example.com/trips/4d67459c-af07-40bb-bb12-178dbb88e09f + origin: https://api.example.com/stations/b2e783e1-c824-4d63-b37a-d8d698862f1d + destination: https://api.example.com/stations/efdbb9d1-02c2-4bc3-afb7-6788d8782b1e links: self: https://api.example.com/trips?origin=efdbb9d1-02c2-4bc3-afb7-6788d8782b1e&destination=b2e783e1-c824-4d63-b37a-d8d698862f1d&date=2024-02-01 next: https://api.example.com/trips?origin=efdbb9d1-02c2-4bc3-afb7-6788d8782b1e&destination=b2e783e1-c824-4d63-b37a-d8d698862f1d&date=2024-02-01&page=2 @@ -739,6 +750,20 @@ components: self: type: string format: uri + Links-Destination: + type: object + description: The link to the destination station resource. + properties: + self: + type: string + format: uri + Links-Origin: + type: object + description: The link to the origin station resource. + properties: + self: + type: string + format: uri Links-Pagination: type: object properties: