Skip to content

Commit eebcdb5

Browse files
authored
Update to spec file (#141)
1 parent 052c4b5 commit eebcdb5

1 file changed

Lines changed: 21 additions & 19 deletions

File tree

specification/nhs-website-content-api.yaml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,13 @@ security:
400400
paths:
401401
/conditions:
402402
parameters:
403-
- $ref: "#/components/parameters/order"
404403
- $ref: "#/components/parameters/page"
405404
- $ref: "#/components/parameters/category"
405+
- $ref: "#/components/parameters/orderBy"
406+
- $ref: "#/components/parameters/startDate"
407+
- $ref: "#/components/parameters/endDate"
408+
- $ref: "#/components/parameters/order"
406409
- $ref: "#/components/parameters/synonyms"
407-
- $ref: "#/components/parameters/status"
408410
get:
409411
summary: Get all pages in the Health A to Z
410412
operationId: get-conditions
@@ -416,7 +418,15 @@ paths:
416418
417419
The response is limited to 25 child pages and is paginated.
418420
419-
There are a number of query parameters that filter the output.
421+
There are a number of query parameters that filter the results.
422+
423+
## Ordering by dates
424+
425+
The `orderBy` parameter can be `dateModified`, `lastReviewed` and `nextReview`. By default if any of the `orderBy` parameters are chosen the results are sorted by newest first.
426+
427+
However, the `orderBy` parameter can be used with the `startDate` and `endDate` parameters to filter down to the desired date. `startDate` and `endDate` should be given in the YYYY-MM-DD format.
428+
429+
For example `https://api.service.nhs.uk/nhs-website-content/conditions?startDate=2022-01-01&orderBy=dateModified`
420430
421431
responses:
422432
"200":
@@ -480,12 +490,12 @@ paths:
480490
| 429 | TOO_MANY_REQUESTS | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
481491
/medicines:
482492
parameters:
483-
- $ref: "#/components/parameters/startDate"
484-
- $ref: "#/components/parameters/endDate"
485-
- $ref: "#/components/parameters/order"
486493
- $ref: "#/components/parameters/page"
487494
- $ref: "#/components/parameters/category"
488495
- $ref: "#/components/parameters/orderBy"
496+
- $ref: "#/components/parameters/startDate"
497+
- $ref: "#/components/parameters/endDate"
498+
- $ref: "#/components/parameters/order"
489499
get:
490500
summary: Get all pages in the Medicines A to Z
491501
operationId: get-medicines
@@ -497,15 +507,15 @@ paths:
497507
498508
The response is limited to 25 child pages and is paginated.
499509
500-
There are a number of query parameters that filter the output.
510+
There are a number of query parameters that filter the results.
501511
502512
## Ordering by dates
503513
504514
The `orderBy` parameter can be `dateModified`, `lastReviewed` and `nextReview`. By default if any of the `orderBy` parameters are chosen the results are sorted by newest first.
505515
506516
However, the `orderBy` parameter can be used with the `startDate` and `endDate` parameters to filter down to the desired date. `startDate` and `endDate` should be given in the YYYY-MM-DD format.
507517
508-
For example `https://api.nhs.uk/medicines?startDate=2022-01-01&orderBy=dateModified`
518+
For example `https://api.service.nhs.uk/nhs-website-content/medicines?startDate=2022-01-01&orderBy=dateModified`
509519
510520
responses:
511521
"200":
@@ -805,15 +815,15 @@ components:
805815
startDate:
806816
name: startDate
807817
in: query
808-
description: Earliest date filter, works with orderBy.
818+
description: Earliest date filter, works with orderBy. Format must be YYYY-MM-DD.
809819
required: false
810820
schema:
811821
type: string
812822
example: "2020-01-01"
813823
endDate:
814824
name: endDate
815825
in: query
816-
description: Latest date filter, works with orderBy.
826+
description: Latest date filter, works with orderBy. Format must be YYYY-MM-DD.
817827
required: false
818828
schema:
819829
type: string
@@ -845,7 +855,7 @@ components:
845855
orderBy:
846856
name: orderBy
847857
in: query
848-
description: works alongside startDate and endDate. Options are "dateModified", "lastReviewed" and "nextReview".
858+
description: Works alongside startDate and endDate. Options are "dateModified", "lastReviewed" and "nextReview".
849859
required: false
850860
schema:
851861
type: string
@@ -858,14 +868,6 @@ components:
858868
schema:
859869
type: boolean
860870
example: true
861-
status:
862-
name: status
863-
in: query
864-
description: Filter by "published" or "unpublished".
865-
required: false
866-
schema:
867-
type: string
868-
example: "published"
869871
modules:
870872
name: modules
871873
in: query

0 commit comments

Comments
 (0)