diff --git a/lib/json-pretty-printing.js b/lib/json-pretty-printing.js index f527178..753a339 100644 --- a/lib/json-pretty-printing.js +++ b/lib/json-pretty-printing.js @@ -7,7 +7,7 @@ const configureJSONPrettyPrinting = (req, res) => { const jsonPrettyPrintingOpenapiParam = { name: 'pretty', - in: 'path', + in: 'query', description: 'Pretty-print JSON responses?', schema: {type: 'boolean'}, } diff --git a/routes/journeys.js b/routes/journeys.js index eb1f429..b1d3617 100644 --- a/routes/journeys.js +++ b/routes/journeys.js @@ -214,6 +214,62 @@ Uses [\`hafasClient.journeys()\`](https://github.com/public-transport/hafas-clie url: 'https://github.com/public-transport/hafas-client/blob/6/docs/journeys.md', }, parameters: [ + { + name: 'from', + in: 'query', + schema: {type: 'string'}, + description: '"from" as stop/station ID (e.g. from=8010159 for Halle (Saale) Hbf)' + }, + { + name: 'from.id', + in: 'query', + schema: {type: 'string'}, + description: '"from" as POI (e.g. from.id=991561765&from.latitude=51.48364&from.longitude=11.98084 for Halle+(Saale),+Stadtpark+Halle+(Grünanlagen))' + }, + { + name: 'from.address', + in: 'query', + schema: {type: 'string'}, + description: '"from" as an address (e.g. from.latitude=51.25639&from.longitude=7.46685&from.address=Hansestadt+Breckerfeld,+Hansering+3 for Hansestadt Breckerfeld, Hansering 3)' + }, + { + name: 'from.latitude', + in: 'query', + schema: {type: 'number'} + }, + { + name: 'from.longitude', + in: 'query', + schema: {type: 'number'} + }, + { + name: 'to', + in: 'query', + schema: {type: 'string'}, + description: '"to" as stop/station ID' + }, + { + name: 'to.id', + in: 'query', + schema: {type: 'string'}, + description: '"to" as POI' + }, + { + name: 'to.address', + in: 'query', + schema: {type: 'string'}, + description: '"to" as an address' + }, + { + name: 'to.latitude', + in: 'query', + schema: {type: 'number'} + }, + { + name: 'to.longitude', + in: 'query', + schema: {type: 'number'} + }, ...formatParsersAsOpenapiParams(parsers), jsonPrettyPrintingOpenapiParam, ],