Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ __pycache__/
smoketest-report.xml
**/.env
**/integration_tests_report.xml

openapitools.json
7 changes: 7 additions & 0 deletions openapitools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be gitignored.

"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "6.2.1"
}
}
7 changes: 5 additions & 2 deletions sandbox/handlers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"use strict";

const log = require("loglevel");
const searchPostcodeOrPlaceResponse = require("./responses/search-postcode_v2.json");
const searchPlaceResponse = require("./responses/search-place_v2.json");
const searchPostcodeResponse = require("./responses/search-postcode_v2.json");
const organisationsResponse = require("./responses/organisations_v2.json");
const organisationsNotFoundResponse = require("./responses/organisations-not-found_v2.json");
const organisationsSingleResponse = require("./responses/organisations-single_v2.json");
Expand Down Expand Up @@ -54,7 +55,9 @@ async function searchPostcodeOrPlace(req, res, next) {
if (queryStringParameters?.["api-version"] !== "2") {
res.status(404).json(resourceNotFound);
} else if (search === "manchester") {
res.status(200).json(searchPostcodeOrPlaceResponse);
res.status(200).json(searchPlaceResponse);
} else if (search === "wc1n 3jh") {
res.status(200).json(searchPostcodeResponse);
} else {
res.status(500).json(populateSearchPostcodeOrPlaceInvalidResponse(search));
}
Expand Down
16 changes: 16 additions & 0 deletions specification/examples/search-place_v2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"place": [
{
"Latitude": 53.478941671902611,
"Longitude": -2.245277998298477,
"text": "Manchester, North West",
"url": "https://api.nhs.uk/service-search/search-postcode-or-place?api-version=1&search=manchester&latitude=53.4789416719026&longitude=-2.24527799829848"
},
{
"Latitude": 53.514265448236706,
"Longitude": -2.4199003923191209,
"text": "New Manchester, North West",
"url": "https://api.nhs.uk/service-search/search-postcode-or-place?api-version=1&search=manchester&latitude=53.5142654482367&longitude=-2.41990039231912"
}
]
}
Loading