Add response for train list

main
Jonas Franz 2 years ago
parent 1600ce601b
commit a354295165
  1. 113
      openapi.yaml

@ -7,6 +7,7 @@ servers:
paths: paths:
/stations: /stations:
get: get:
operationId: getStations
tags: tags:
- station - station
summary: List all stations summary: List all stations
@ -25,6 +26,7 @@ paths:
$ref: '#/components/schemas/GetStationsResponse' $ref: '#/components/schemas/GetStationsResponse'
/stations/nearest: /stations/nearest:
get: get:
operationId: getNearestStation
tags: tags:
- station - station
summary: List nearest stations summary: List nearest stations
@ -61,13 +63,18 @@ paths:
get: get:
tags: tags:
- train - train
operationId: getTrainList
summary: Find train connections for a specific route summary: Find train connections for a specific route
description: This operation uses the v2-Version of the API. Please update the baseUrl accordingly. To get a correct result, you have to specify at least one passenger.
servers:
- url: https://wsmr.renfe.es/wsmRestApi/v2/
parameters: parameters:
- $ref: '#/components/parameters/app' - $ref: '#/components/parameters/app'
- $ref: '#/components/parameters/appVersion' - $ref: '#/components/parameters/appVersion'
- $ref: '#/components/parameters/osName' - $ref: '#/components/parameters/osName'
- $ref: '#/components/parameters/osVersion' - $ref: '#/components/parameters/osVersion'
- $ref: '#/components/parameters/language' - $ref: '#/components/parameters/language'
- $ref: '#/components/parameters/businessFlow'
- in: query - in: query
name: outwardStation name: outwardStation
required: true required: true
@ -132,8 +139,23 @@ paths:
responses: responses:
'200': '200':
description: OK description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetTrainListResponse'
components: components:
parameters: parameters:
businessFlow:
name: businessFlow
required: false
in: header
schema:
type: string
enum:
- PURCHASE
- DETAIL
- CHANGE
- CANCELATION
app: app:
name: app name: app
required: true required: true
@ -170,6 +192,24 @@ components:
type: string type: string
example: 'en' example: 'en'
schemas: schemas:
GetTrainListResponse:
type: object
required:
- trainProductsDiscountsOutward
- trainProductsDiscountsReturn
properties:
trainProductsDiscountsOutward:
type: boolean
trainProductsDiscountsReturn:
type: boolean
trainListOutward:
type: array
items:
$ref: '#/components/schemas/Train'
trainListReturn:
type: array
items:
$ref: '#/components/schemas/Train'
GetStationsResponse: GetStationsResponse:
type: object type: object
required: required:
@ -184,6 +224,79 @@ components:
format: 'date-time' format: 'date-time'
pattern: /([0-9]{4})-(?:[0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2}).([0-9]{3})/ pattern: /([0-9]{4})-(?:[0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2}).([0-9]{3})/
example: "2022-03-01 01:06:25.034" example: "2022-03-01 01:06:25.034"
Train:
type: object
properties:
originDate:
type: string
format: date
pattern: /([0-9]{2}-[0-9]{2}-[0-9]{4}/
example: 10-04-2022
originTime:
type: string
format: time
example: 06:35
arrivalDate:
type: string
format: date
pattern: /([0-9]{2}-[0-9]{2}-[0-9]{4}/
example: 10-04-2022
arrivalTime:
type: string
format: time
example: 09:20
trainCode:
type: string
example: 06302
trainDescription:
type: string
example: AVLO
trainOperator:
type: string
example: LC
trainProductCode:
type: string
example: 112
travelDuration:
type: string
example: 2 h. 45 min.
availableForSale:
type: boolean
blocked:
type: boolean
completed:
type: boolean
trainGroupCodeForm:
type: boolean
travelException:
type: boolean
datosLargoPlazo:
type: object
properties:
rsvLargoPlazo:
type: boolean
originStation:
$ref: '#/components/schemas/TrainStation'
arrivalStation:
$ref: '#/components/schemas/TrainStation'
trainProductsDiscounts:
type: boolean
TrainStation:
type: object
properties:
stationCode:
type: string
example: 71801
stationDescription:
type: string
example: BCN-SANTS
largeDescription:
type: string
example: BARCELONA-SANTS
saleEnabled:
type: boolean
enabled:
type: boolean
Station: Station:
type: object type: object
properties: properties:

Loading…
Cancel
Save