Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/mds-geography-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"_build": "tsc --build tsconfig.build.json",
"_test": "PATH_PREFIX=/geography jest --runInBand",
"build": "pnpm _build",
"mock": "prism mock spec/spec.yaml -p 7011",
"start": "PATH_PREFIX=/geography pnpm watch server",
"test": "pnpm _test",
"ts-node": "pnpm build && ts-node -r ../../dotenv-flow.js",
Expand All @@ -27,7 +28,8 @@
"express": "4.17.1"
},
"devDependencies": {
"@mds-core/mds-test-data": "workspace:0.4.32"
"@mds-core/mds-test-data": "workspace:0.4.32",
"@stoplight/prism-cli": "4.8.0"
},
"publishConfig": {
"main": "dist/index.js"
Expand Down
17 changes: 17 additions & 0 deletions packages/mds-geography-api/spec/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# API specification

The MDS geography API provides an OMF compliant implementation of [`/geographies` in version 1.0](https://github.com/openmobilityfoundation/mobility-data-specification/tree/release-1.0.0/policy#geographies)

_Remark: After 1.0, `/geographies` has been moved to an own specification with a slightly different format. This is not supported by the current implementation_

## Mocking

This package features [Primsm](https://github.com/stoplightio/prism) to provide a mocking server based on the examples included in the specification.
Run it with `pnpm mock`

Plase see the [mocking documentation](https://github.com/stoplightio/prism/blob/master/docs/guides/01-mocking.md#response-generation) for instructions how to retrieve a dedicated example, e. g.

```bash
curl http://localhost:7011/geographies/10000000-0000-0000-0000-000000000001 \
-H "Prefer: example=HistoricRome"
```
Loading