Skip to content

Commit 6bffb42

Browse files
authored
Specifying the required ‘apikey’ header value using the ‘securitySchemes’ section (#97)
1 parent e44f743 commit 6bffb42

2 files changed

Lines changed: 6 additions & 29 deletions

File tree

specification/components/schemas/ApiKey.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

specification/nhs-website-content-api.yaml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,11 @@ servers:
254254
description: Integration test environment.
255255
- url: "https://api.service.nhs.uk/nhs-website-content"
256256
description: Production environment.
257+
security:
258+
- apikey: []
257259
paths:
258260
/conditions:
259261
parameters:
260-
- $ref: "#/components/parameters/apikey"
261262
- $ref: "#/components/parameters/order"
262263
- $ref: "#/components/parameters/page"
263264
- $ref: "#/components/parameters/category"
@@ -299,7 +300,6 @@ paths:
299300
| 429 | TOO_MANY_REQUESTS | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
300301
/conditions/*:
301302
parameters:
302-
- $ref: "#/components/parameters/apikey"
303303
- $ref: "#/components/parameters/modules"
304304
get:
305305
summary: Get details of a condition page
@@ -340,7 +340,6 @@ paths:
340340
| 429 | TOO_MANY_REQUESTS | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
341341
/medicines:
342342
parameters:
343-
- $ref: "#/components/parameters/apikey"
344343
- $ref: "#/components/parameters/startDate"
345344
- $ref: "#/components/parameters/endDate"
346345
- $ref: "#/components/parameters/order"
@@ -390,7 +389,6 @@ paths:
390389
| 429 | TOO_MANY_REQUESTS | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
391390
/medicines/*:
392391
parameters:
393-
- $ref: "#/components/parameters/apikey"
394392
- $ref: "#/components/parameters/modules"
395393
get:
396394
summary: Get specific medicine page
@@ -430,8 +428,6 @@ paths:
430428
| 404 | RESOURCE_NOT_FOUND | Page not found. |
431429
| 429 | TOO_MANY_REQUESTS | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
432430
/mental-health:
433-
parameters:
434-
- $ref: "#/components/parameters/apikey"
435431
get:
436432
summary: Get content from the mental health hub
437433
operationId: get-mental-health
@@ -465,8 +461,6 @@ paths:
465461
| 404 | RESOURCE_NOT_FOUND | Page not found. |
466462
| 429 | TOO_MANY_REQUESTS | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
467463
/live-well:
468-
parameters:
469-
- $ref: "#/components/parameters/apikey"
470464
get:
471465
summary: Get content from the Live Well hub.
472466
operationId: get-live-well
@@ -499,8 +493,6 @@ paths:
499493
| 404 | RESOURCE_NOT_FOUND | Page not found. |
500494
| 429 | TOO_MANY_REQUESTS | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
501495
/pregnancy:
502-
parameters:
503-
- $ref: "#/components/parameters/apikey"
504496
get:
505497
summary: Get content from the pregnancy hub
506498
operationId: get-pregnancy
@@ -534,8 +526,6 @@ paths:
534526
| 404 | RESOURCE_NOT_FOUND | Page not found. |
535527
| 429 | TOO_MANY_REQUESTS | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
536528
/nhs-services:
537-
parameters:
538-
- $ref: "#/components/parameters/apikey"
539529
get:
540530
summary: Get content from the NHS services hub
541531
operationId: get-nhs-services
@@ -569,8 +559,6 @@ paths:
569559
| 404 | RESOURCE_NOT_FOUND | Page not found. |
570560
| 429 | TOO_MANY_REQUESTS | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
571561
/common-health-questions:
572-
parameters:
573-
- $ref: "#/components/parameters/apikey"
574562
get:
575563
summary: Get content from the common health questions hub
576564
operationId: get-common-health-questions
@@ -604,18 +592,12 @@ paths:
604592
| 404 | RESOURCE_NOT_FOUND | Page not found. |
605593
| 429 | TOO_MANY_REQUESTS | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
606594
components:
607-
headers:
608-
apikey:
609-
$ref: components/schemas/ApiKey.yaml
610-
parameters:
595+
securitySchemes:
611596
apikey:
597+
type: apiKey
598+
in: header
612599
name: apikey
613-
in: query
614-
description: The API key required to send a successful request.
615-
required: true
616-
schema:
617-
type: string
618-
example: "aTfjAa9vHfnmaQNABgSXGFCS9SFVMLWc"
600+
parameters:
619601
startDate:
620602
name: startDate
621603
in: query

0 commit comments

Comments
 (0)