From ea645c048da0d9018d63f98f8bedb3e1c9d62875 Mon Sep 17 00:00:00 2001 From: mvglasow Date: Thu, 16 Mar 2023 22:01:59 +0200 Subject: [PATCH 1/7] Move autobahn/ from base URL to individual URLs Signed-off-by: mvglasow --- openapi.yaml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 175537a..21519ed 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -5,11 +5,11 @@ info: description: | Was passiert auf Deutschlands Bundesstraßen? API für aktuelle Verwaltungsdaten zu Baustellen, Staus und Ladestationen. Außerdem Zugang zu Verkehrsüberwachungskameras und vielen weiteren Datensätzen. servers: - - url: https://verkehr.autobahn.de/o/autobahn + - url: https://verkehr.autobahn.de/o paths: - /: + /autobahn/: get: operationId: list-autobahnen summary: Liste verfügbarer Autobahnen @@ -22,7 +22,7 @@ paths: schema: $ref: "#/components/schemas/Roads" - /{roadId}/services/roadworks: + /autobahn/{roadId}/services/roadworks: get: operationId: list-roadworks summary: Liste aktueller Baustellen @@ -47,7 +47,7 @@ paths: "404": description: Not found. - /details/roadworks/{roadworkId}: + /autobahn/details/roadworks/{roadworkId}: get: operationId: get-roadwork summary: Details einer Baustelle @@ -74,7 +74,7 @@ paths: "404": description: Not found. - /{roadId}/services/webcam: + /autobahn/{roadId}/services/webcam: get: operationId: list-webcams summary: Liste verfügbarer Webcams @@ -100,7 +100,7 @@ paths: description: Not found. # https://verkehr.autobahn.de/o/autobahn/details/webcam/%5BID%5D - /details/webcam/{webcamId}: + /autobahn/details/webcam/{webcamId}: get: operationId: get-webcam summary: Details einer Webcam @@ -127,7 +127,7 @@ paths: "404": description: Not found. - /{roadId}/services/parking_lorry: + /autobahn/{roadId}/services/parking_lorry: get: operationId: list-parking-lorries summary: Liste verfügbarer Rastplätze @@ -152,7 +152,7 @@ paths: "404": description: Not found. - /details/parking_lorry/{lorryId}: + /autobahn/details/parking_lorry/{lorryId}: get: operationId: get-parking-lorry summary: Details eines Rastplatzes @@ -179,7 +179,7 @@ paths: "404": description: Not found. - /{roadId}/services/warning: + /autobahn/{roadId}/services/warning: get: operationId: list-warnings summary: Liste aktueller Verkehrsmeldungen @@ -204,7 +204,7 @@ paths: "404": description: Not found. - /details/warning/{warningId}: + /autobahn/details/warning/{warningId}: get: operationId: get-warning summary: Details zu einer Verkehrsmeldung @@ -231,7 +231,7 @@ paths: "404": description: Not found. - /{roadId}/services/closure: + /autobahn/{roadId}/services/closure: get: operationId: list-closures summary: Liste aktueller Sperrungen @@ -256,7 +256,7 @@ paths: "404": description: Not found. - /details/closure/{closureId}: + /autobahn/details/closure/{closureId}: get: operationId: get-closure summary: Details zu einer Sperrung @@ -283,7 +283,7 @@ paths: "404": description: Not found. - /{roadId}/services/electric_charging_station: + /autobahn/{roadId}/services/electric_charging_station: get: operationId: list-charging-stations summary: Liste aktueller Ladestationen @@ -308,7 +308,7 @@ paths: "404": description: Not found. - /details/electric_charging_station/{stationId}: + /autobahn/details/electric_charging_station/{stationId}: get: operationId: get-charging-station summary: Details zu einer Ladestation From 9397bcb480128098b59b99c5fde33d90c617f0e9 Mon Sep 17 00:00:00 2001 From: mvglasow Date: Thu, 16 Mar 2023 22:24:38 +0200 Subject: [PATCH 2/7] Add URLs for list of roads affected Signed-off-by: mvglasow --- openapi.yaml | 130 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 126 insertions(+), 4 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 21519ed..8b05e57 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -22,6 +22,23 @@ paths: schema: $ref: "#/components/schemas/Roads" + /services/roadworks: + get: + operationId: list-roadworks-all + summary: Liste verfügbarer Autobahnen mit aktuellen Baustellen + description: Gibt eine Liste der verfügbaren Autobahnen mit aktuellen Baustellen zurück. + parameters: + - name: roadId + in: path + required: true + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/RoadsAffected" + /autobahn/{roadId}/services/roadworks: get: operationId: list-roadworks @@ -127,11 +144,45 @@ paths: "404": description: Not found. + /services/parking: + get: + operationId: list-parking-all + summary: Liste verfügbarer Autobahnen mit Rastplätzen + description: Gibt eine Liste der verfügbaren Autobahnen mit Rastplätzen zurück. + parameters: + - name: roadId + in: path + required: true + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/RoadsAffected" + + /services/parking_lorry: + get: + operationId: list-parking-lorry-all + summary: Liste verfügbarer Autobahnen mit Lkw-Rastplätzen + description: Gibt eine Liste der verfügbaren Autobahnen mit Lkw-Rastplätzen zurück. + parameters: + - name: roadId + in: path + required: true + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/RoadsAffected" + /autobahn/{roadId}/services/parking_lorry: get: operationId: list-parking-lorries - summary: Liste verfügbarer Rastplätze - description: Gibt eine Liste der Rastplätze zu einer Autobahn zurück. + summary: Liste verfügbarer Lkw-Rastplätze + description: Gibt eine Liste der Lkw-Rastplätze zu einer Autobahn zurück. parameters: - name: roadId in: path @@ -155,8 +206,8 @@ paths: /autobahn/details/parking_lorry/{lorryId}: get: operationId: get-parking-lorry - summary: Details eines Rastplatzes - description: Gibt Details eines konkreten Rastplatzes zurück. + summary: Details eines Lkw-Rastplatzes + description: Gibt Details eines konkreten Lkw-Rastplatzes zurück. parameters: - name: lorryId in: path @@ -179,6 +230,23 @@ paths: "404": description: Not found. + /services/warning: + get: + operationId: list-warning-all + summary: Liste verfügbarer Autobahnen mit Verkehrsmeldungen + description: Gibt eine Liste der verfügbaren Autobahnen mit Verkehrsmeldungen zurück. + parameters: + - name: roadId + in: path + required: true + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/RoadsAffected" + /autobahn/{roadId}/services/warning: get: operationId: list-warnings @@ -231,6 +299,23 @@ paths: "404": description: Not found. + /services/closure: + get: + operationId: list-closures-all + summary: Liste verfügbarer Autobahnen mit aktuellen Sperrungen + description: Gibt eine Liste der verfügbaren Autobahnen mit aktuellen Sperrungen zurück. + parameters: + - name: roadId + in: path + required: true + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/RoadsAffected" + /autobahn/{roadId}/services/closure: get: operationId: list-closures @@ -283,6 +368,23 @@ paths: "404": description: Not found. + /services/electric_charging_station: + get: + operationId: list-charging-stations-all + summary: Liste verfügbarer Autobahnen mit Ladestationen + description: Gibt eine Liste der verfügbaren Autobahnen mit Ladestationen zurück. + parameters: + - name: roadId + in: path + required: true + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/RoadsAffected" + /autobahn/{roadId}/services/electric_charging_station: get: operationId: list-charging-stations @@ -351,6 +453,26 @@ components: pattern: 'A[1-9]([0-9]{1,3})?(\/A[1-9]{1,3})?' example: "A1" + RoadsAffected: + type: object + properties: + roadCounter: + type: array + items: + $ref: '#/components/schemas/RoadCounter' + + RoadCounter: + type: object + example: { + "road": "A1", + "counter": "99" + } + properties: + road: + $ref: '#/components/schemas/RoadId' + counter: + type: number + Extent: type: string pattern: '-?\d+(?:\.\d+)?,\s*-?\d+(?:\.\d+)?,\s*-?\d+(?:\.\d+)?,\s*-?\d+(?:\.\d+)?' From b8d456119031326958180866aef86eb98ebdb352 Mon Sep 17 00:00:00 2001 From: mvglasow Date: Thu, 16 Mar 2023 22:29:16 +0200 Subject: [PATCH 3/7] Add service /parking for passenger vehicle parking Signed-off-by: mvglasow --- openapi.yaml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 8b05e57..8f020c9 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -161,6 +161,58 @@ paths: schema: $ref: "#/components/schemas/RoadsAffected" + /autobahn/{roadId}/services/parking: + get: + operationId: list-parkings + summary: Liste verfügbarer Rastplätze + description: Gibt eine Liste der Rastplätze zu einer Autobahn zurück. + parameters: + - name: roadId + in: path + required: true + schema: + $ref: "#/components/schemas/RoadId" + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/ParkingLorries" + "204": + description: Not found. + "400": + description: Internal server error. + "404": + description: Not found. + + /autobahn/details/parking/{parkingId}: + get: + operationId: get-parking + summary: Details eines Rastplatzes + description: Gibt Details eines konkreten Rastplatzes zurück. + parameters: + - name: parkingId + in: path + required: true + schema: + type: string + format: byte + example: "UEFSS0lOR19fbWRtLmxvcnJ5LnBhcmtpbmdfX0RFLVNILTAwMTEwOA==" + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/ParkingLorry" + "204": + description: Not found. + "400": + description: Internal server error. + "404": + description: Not found. + /services/parking_lorry: get: operationId: list-parking-lorry-all From aed04cb8c606ee5fd583b3cfb3024644fbfe46e8 Mon Sep 17 00:00:00 2001 From: mvglasow Date: Mon, 20 Mar 2023 20:10:18 +0200 Subject: [PATCH 4/7] Ditch invalid parameters sections where they are not needed Signed-off-by: mvglasow --- openapi.yaml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 8f020c9..8fe0fab 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -27,10 +27,6 @@ paths: operationId: list-roadworks-all summary: Liste verfügbarer Autobahnen mit aktuellen Baustellen description: Gibt eine Liste der verfügbaren Autobahnen mit aktuellen Baustellen zurück. - parameters: - - name: roadId - in: path - required: true responses: "200": description: Success @@ -149,10 +145,6 @@ paths: operationId: list-parking-all summary: Liste verfügbarer Autobahnen mit Rastplätzen description: Gibt eine Liste der verfügbaren Autobahnen mit Rastplätzen zurück. - parameters: - - name: roadId - in: path - required: true responses: "200": description: Success @@ -218,10 +210,6 @@ paths: operationId: list-parking-lorry-all summary: Liste verfügbarer Autobahnen mit Lkw-Rastplätzen description: Gibt eine Liste der verfügbaren Autobahnen mit Lkw-Rastplätzen zurück. - parameters: - - name: roadId - in: path - required: true responses: "200": description: Success @@ -287,10 +275,6 @@ paths: operationId: list-warning-all summary: Liste verfügbarer Autobahnen mit Verkehrsmeldungen description: Gibt eine Liste der verfügbaren Autobahnen mit Verkehrsmeldungen zurück. - parameters: - - name: roadId - in: path - required: true responses: "200": description: Success @@ -356,10 +340,6 @@ paths: operationId: list-closures-all summary: Liste verfügbarer Autobahnen mit aktuellen Sperrungen description: Gibt eine Liste der verfügbaren Autobahnen mit aktuellen Sperrungen zurück. - parameters: - - name: roadId - in: path - required: true responses: "200": description: Success @@ -425,10 +405,6 @@ paths: operationId: list-charging-stations-all summary: Liste verfügbarer Autobahnen mit Ladestationen description: Gibt eine Liste der verfügbaren Autobahnen mit Ladestationen zurück. - parameters: - - name: roadId - in: path - required: true responses: "200": description: Success From 95a13346d51621e28d9c9a3f26c89cf15274bc48 Mon Sep 17 00:00:00 2001 From: mvglasow Date: Tue, 23 May 2023 20:58:14 +0300 Subject: [PATCH 5/7] Remove trailing slash in paths Signed-off-by: mvglasow --- openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 8fe0fab..3752ff5 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -9,7 +9,7 @@ servers: paths: - /autobahn/: + /autobahn: get: operationId: list-autobahnen summary: Liste verfügbarer Autobahnen From 4bdff9507327efae811db709387b9f0541084c66 Mon Sep 17 00:00:00 2001 From: mvglasow Date: Fri, 26 May 2023 15:23:26 +0300 Subject: [PATCH 6/7] Fix type for counter in list of roads affected Signed-off-by: mvglasow --- openapi.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 3752ff5..46f7978 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -499,7 +499,8 @@ components: road: $ref: '#/components/schemas/RoadId' counter: - type: number + type: string + pattern: 'd+' Extent: type: string From c056a7138e239fb37ac2d2a2decbe75a7577f956 Mon Sep 17 00:00:00 2001 From: mvglasow Date: Fri, 26 May 2023 16:20:31 +0300 Subject: [PATCH 7/7] Fix RoadCounter pattern Signed-off-by: mvglasow --- openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 46f7978..83bf204 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -500,7 +500,7 @@ components: $ref: '#/components/schemas/RoadId' counter: type: string - pattern: 'd+' + pattern: '\d+' Extent: type: string