Skip to content

Commit

Permalink
openapi: add missing/fix request params
Browse files Browse the repository at this point in the history
  • Loading branch information
traines-source committed Nov 18, 2024
1 parent 2550e4e commit 6484ab3
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/json-pretty-printing.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const configureJSONPrettyPrinting = (req, res) => {

const jsonPrettyPrintingOpenapiParam = {
name: 'pretty',
in: 'path',
in: 'query',
description: 'Pretty-print JSON responses?',
schema: {type: 'boolean'},
}
Expand Down
56 changes: 56 additions & 0 deletions routes/journeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
],
Expand Down

0 comments on commit 6484ab3

Please sign in to comment.