You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
138 lines
2.5 KiB
138 lines
2.5 KiB
{ |
|
"$schema": "http://json-schema.org/schema", |
|
"title": "Train Info InfoFer Scrap Station Schema", |
|
"description": "Results of scrapping InfoFer website for station arrival/departure info", |
|
"definitions": { |
|
"arrDepItem": { |
|
"type": "object", |
|
"properties": { |
|
"time": { |
|
"description": "Time of arrival/departure", |
|
"type": "string", |
|
"format": "date-time" |
|
}, |
|
"train": { |
|
"type": "object", |
|
"properties": { |
|
"rank": { |
|
"type": "string", |
|
"examples": [ |
|
"R", |
|
"R-E", |
|
"IR", |
|
"IRN" |
|
] |
|
}, |
|
"number": { |
|
"type": "string", |
|
"examples": [ |
|
"74", |
|
"15934" |
|
] |
|
}, |
|
"operator": { |
|
"type": "string", |
|
"examples": [ |
|
"CFR Călători", |
|
"Softrans", |
|
"Regio Călători" |
|
] |
|
}, |
|
"route": { |
|
"description": "All the stations the train stops at", |
|
"type": "array", |
|
"items": { |
|
"type": "string" |
|
} |
|
} |
|
}, |
|
"required": [ |
|
"rank", |
|
"number", |
|
"operator" |
|
] |
|
}, |
|
"stoppingTime": { |
|
"description": "The number of seconds the train stops in the station", |
|
"type": [ |
|
"integer", |
|
"null" |
|
], |
|
"minimum": 0 |
|
} |
|
}, |
|
"required": [ |
|
"time", |
|
"train", |
|
"stoppingTime" |
|
] |
|
} |
|
}, |
|
"type": "object", |
|
"properties": { |
|
"arrivals": { |
|
"type": ["array", "null"], |
|
"items": { |
|
"allOf": [ |
|
{ |
|
"$ref": "#/definitions/arrDepItem" |
|
}, |
|
{ |
|
"type": "object", |
|
"properties": { |
|
"train": { |
|
"type": "object", |
|
"properties": { |
|
"origin": { |
|
"type": "string" |
|
} |
|
}, |
|
"required": ["origin"] |
|
} |
|
}, |
|
"required": ["train"] |
|
} |
|
] |
|
} |
|
}, |
|
"departures": { |
|
"type": ["array", "null"], |
|
"items": { |
|
"allOf": [ |
|
{ |
|
"$ref": "#/definitions/arrDepItem" |
|
}, |
|
{ |
|
"type": "object", |
|
"properties": { |
|
"train": { |
|
"type": "object", |
|
"properties": { |
|
"destination": { |
|
"type": "string" |
|
} |
|
}, |
|
"required": ["destination"] |
|
} |
|
}, |
|
"required": ["train"] |
|
} |
|
] |
|
} |
|
}, |
|
"stationName": { |
|
"type": "string" |
|
}, |
|
"date": { |
|
"description": "Date for which the data is provided (likely today)", |
|
"type": "string", |
|
"pattern": "^[0-9]{1,2}\\.[0-9]{2}\\.[0-9]{4}$" |
|
} |
|
}, |
|
"required": [ |
|
"arrivals", |
|
"departures", |
|
"stationName", |
|
"date" |
|
] |
|
} |