Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 7994374

Browse files
docs: Added OpenAPI spec and API request collection
1 parent 4816b4f commit 7994374

File tree

2 files changed

+127
-0
lines changed

2 files changed

+127
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"log": {
3+
"version": "1.2",
4+
"creator": {
5+
"name": "Insomnia REST Client",
6+
"version": "insomnia.desktop.app:v11.0.1"
7+
},
8+
"entries": [
9+
{
10+
"startedDateTime": "2025-04-04T09:29:36.496Z",
11+
"time": 0,
12+
"request": {
13+
"method": "POST",
14+
"url": "http://localhost:7001/api/bsselect/episodes/ingress",
15+
"httpVersion": "HTTP/1.1",
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"name": "Content-Type",
20+
"value": "application/json"
21+
}
22+
],
23+
"queryString": [],
24+
"postData": {
25+
"mimeType": "application/json",
26+
"text": "{\n\t\"episode_id\": \"123\",\n\t\"nhs_number\": \"9990000000\",\n\t\"date_of_birth\": \"1970-01-01\",\n\t\"first_given_name\": \"Test\",\n\t\"family_name\": \"User\"\n}"
27+
},
28+
"headersSize": -1,
29+
"bodySize": -1
30+
},
31+
"response": {
32+
"status": 0,
33+
"statusText": "",
34+
"httpVersion": "HTTP/1.1",
35+
"cookies": [],
36+
"headers": [],
37+
"content": {
38+
"size": 0,
39+
"mimeType": ""
40+
},
41+
"redirectURL": "",
42+
"headersSize": -1,
43+
"bodySize": -1
44+
},
45+
"cache": {},
46+
"timings": {
47+
"blocked": -1,
48+
"dns": -1,
49+
"connect": -1,
50+
"send": 0,
51+
"wait": 0,
52+
"receive": 0,
53+
"ssl": -1
54+
},
55+
"comment": "BS Select Episode Ingress"
56+
}
57+
]
58+
}
59+
}

api/openapi/openapi.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
openapi: 3.0.3
2+
info:
3+
title: ServiceLayer API
4+
version: 1.0.0
5+
description: API used to ingest episodes from screening services into NSP
6+
7+
paths:
8+
9+
/bsselect/episodes/ingress:
10+
post:
11+
summary: BS Select Episode Ingress
12+
description: Validates the incoming BS Select episode and enqueues it for further processing within the NSP
13+
operationId: BS Select Episode Ingress
14+
tags:
15+
- Episodes
16+
requestBody:
17+
required: true
18+
content:
19+
application/json:
20+
schema:
21+
$ref: "#/components/schemas/BSSelectEpisode"
22+
responses:
23+
'200':
24+
description: Episode accepted
25+
content:
26+
application/json:
27+
schema:
28+
$ref: "#/components/schemas/BSSelectEpisode"
29+
'400':
30+
description: Bad request. Supplied episode payload invalid.
31+
content:
32+
text/plain:
33+
schema:
34+
type: string
35+
example: "nhs_number is required"
36+
'500':
37+
description: Internal server error. This indicates an unexpected failure in the service.
38+
39+
components:
40+
schemas:
41+
BSSelectEpisode:
42+
type: object
43+
required:
44+
- episode_id
45+
- nhs_number
46+
- date_of_birth
47+
- first_given_name
48+
- family_name
49+
properties:
50+
episode_id:
51+
type: string
52+
description: Unique identifier for the Episode
53+
nhs_number:
54+
type: string
55+
pattern: '^\d{10}$'
56+
description: NHS Number (exactly 10 digits)
57+
date_of_birth:
58+
type: string
59+
format: date
60+
description: Date of birth of the Participant
61+
first_given_name:
62+
type: string
63+
maxLength: 100
64+
description: First name of the Participant
65+
family_name:
66+
type: string
67+
maxLength: 100
68+
description: Surname of the Participant

0 commit comments

Comments
 (0)