From 60c54c29b0c9c6777f5eec4b88d7f28d64302dfb Mon Sep 17 00:00:00 2001 From: Chiara Date: Fri, 7 Jun 2024 09:39:27 +0100 Subject: [PATCH 1/2] Standardising open api --- openapi.yml | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/openapi.yml b/openapi.yml index f21bf5d9c..d81e5d8d7 100644 --- a/openapi.yml +++ b/openapi.yml @@ -86,7 +86,7 @@ paths: - persons summary: Returns a person. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" responses: "200": description: Successfully found a person with the provided HMPPS ID. @@ -127,7 +127,7 @@ paths: - persons summary: Returns metadata of images associated with a person ordered by newest to oldest date. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" - $ref: "#/components/parameters/Page" - $ref: "#/components/parameters/PerPage" responses: @@ -211,7 +211,7 @@ paths: - persons summary: Returns addresses associated with a person. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" - $ref: "#/components/parameters/Page" - $ref: "#/components/parameters/PerPage" responses: @@ -259,7 +259,7 @@ paths: Offences are retrieved from Prison and Probation systems exclusively. Prison systems record only custodial sentences, while Probation systems record only the main offence and some additional offences for case management purposes. Other offences recorded by HMCTS and police may not be included. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" - $ref: "#/components/parameters/Page" - $ref: "#/components/parameters/PerPage" responses: @@ -303,7 +303,7 @@ paths: - alerts summary: Returns alerts associated with a person. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" - $ref: "#/components/parameters/Page" - $ref: "#/components/parameters/PerPage" responses: @@ -347,7 +347,7 @@ paths: - alerts summary: Returns alerts associated with a person. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" - $ref: "#/components/parameters/Page" - $ref: "#/components/parameters/PerPage" responses: @@ -390,7 +390,7 @@ paths: - persons summary: Returns sentences associated with a person. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" - $ref: "#/components/parameters/Page" - $ref: "#/components/parameters/PerPage" responses: @@ -433,7 +433,7 @@ paths: - persons summary: Returns the key dates and adjustments about a person's release from prison for their latest sentence. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" responses: "200": description: Successfully found latest sentence key dates and adjustments for a person with the provided HMPPS ID. @@ -469,7 +469,7 @@ paths: - risks summary: Returns risk scores from the last year associated with a person. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" - $ref: "#/components/parameters/Page" - $ref: "#/components/parameters/PerPage" responses: @@ -512,7 +512,7 @@ paths: - persons summary: Returns the categories related to an offender. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" responses: "200": description: Successfully found risk categories for a person with the provided HMPPS ID. @@ -560,7 +560,7 @@ paths: - persons summary: Returns the mappa detail related to a person. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" responses: "200": description: Successfully found mappa detail for a person with the provided HMPPS ID. @@ -624,7 +624,7 @@ paths: Note: Criminogenic needs are dynamic factors that are directly linked to criminal behaviour. Eight criminogenic needs are measured in OASys: Accommodation, Employability, Relationships, Lifestyle and Associates, Drug Misuse, Alcohol Misuse, Thinking & Behaviour and Attitudes. These are scored according to whether there is “no need”, “some need” or “severe need”, and a need is identified in a specific section based on calculations around these scores. However, the process by which needs are assessed is changing as early as next year (2024), specifically moving to a strength-based model that seeks to identify and develop the strengths of people with convictions. As a consequence of this, the information provided by this endpoint will also change. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" responses: "200": description: Successfully found criminogenic needs for a person with the provided HMPPS ID. @@ -660,7 +660,7 @@ paths: - risks summary: Returns Risk of Serious Harm (ROSH) risks associated with a person. Returns only assessments completed in the last year. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" responses: "200": description: Successfully found risks for a person with the provided HMPPS ID. @@ -695,7 +695,7 @@ paths: - risks summary: Returns a list of Risk Management Plans created for the person with the provided HMPPS ID. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" responses: "200": description: Successfully found risk management plans for a person with the provided HMPPS ID. @@ -752,7 +752,7 @@ paths: schema: $ref: '#/components/schemas/CaseDetails' "404": - description: "A person detail with the provided HmppsId and event number does not exist in Delius." + description: "A person detail with the provided hmppsId and event number does not exist in Delius." content: application/json: schema: @@ -787,7 +787,7 @@ paths: schema: $ref: '#/components/schemas/Adjudication' "404": - description: "Adjudications for the person with the provided HmppsId does not exist." + description: "Adjudications for the person with the provided hmppsId does not exist." content: application/json: schema: @@ -805,11 +805,11 @@ paths: NoQueryParametersBadRequestError: $ref: "#/components/examples/InternalServerError" - /v1/persons/{HmppsId}/person-responsible-officer: + /v1/persons/{hmppsId}/person-responsible-officer: get: summary: Returns the person responsible officer associated with a person. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" responses: "200": description: Successfully found the person responsible officer for a person with the provided HMPPS ID. @@ -839,11 +839,11 @@ paths: NoQueryParametersBadRequestError: $ref: "#/components/examples/InternalServerError" - /v1/persons/{HmppsId}/licences/conditions: + /v1/persons/{hmppsId}/licences/conditions: get: summary: Returns license conditions associated with a person. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" responses: "200": description: Successfully found licenses for a person with the provided HMPPS ID. @@ -870,7 +870,7 @@ paths: NoQueryParametersBadRequestError: $ref: "#/components/examples/InternalServerError" - /v1/persons/{HmppsId}/case-notes: + /v1/persons/{hmppsId}/case-notes: get: summary: Returns case notes associated with a person. parameters: @@ -892,7 +892,7 @@ paths: type: string required: false description: Filter by the location. example MDI - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" responses: "200": description: Successfully found case notes for a person with the provided HMPPS ID. @@ -927,11 +927,11 @@ paths: NoQueryParametersBadRequestError: $ref: "#/components/examples/InternalServerError" - /v1/persons/{HmppsId}/protected-characteristics: + /v1/persons/{hmppsId}/protected-characteristics: get: summary: Returns protected characteristics of a person. parameters: - - $ref: "#/components/parameters/HmppsId" + - $ref: "#/components/parameters/hmppsId" responses: "200": description: Successfully found licenses for a person with the provided HMPPS ID. @@ -962,7 +962,7 @@ paths: $ref: "#/components/examples/InternalServerError" components: parameters: - HmppsId: + hmppsId: name: hmppsId description: A URL-encoded HMPPS identifier example: 2008%2F0545166T From fd07b7449f017b4042951ffc75d2b340d1dd6b72 Mon Sep 17 00:00:00 2001 From: Chiara Date: Fri, 7 Jun 2024 11:25:22 +0100 Subject: [PATCH 2/2] Cleanup --- openapi.yml | 44 ++++++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/openapi.yml b/openapi.yml index d81e5d8d7..1304bf49e 100644 --- a/openapi.yml +++ b/openapi.yml @@ -45,8 +45,8 @@ paths: default: false required: false description: Whether to return results that match the search criteria within the aliases of a person - - $ref: "#/components/parameters/Page" - - $ref: "#/components/parameters/PerPage" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/perPage" responses: "200": description: Successfully performed the query on upstream APIs. An empty list is returned when no results are found. @@ -128,8 +128,8 @@ paths: summary: Returns metadata of images associated with a person ordered by newest to oldest date. parameters: - $ref: "#/components/parameters/hmppsId" - - $ref: "#/components/parameters/Page" - - $ref: "#/components/parameters/PerPage" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/perPage" responses: "200": description: > @@ -212,8 +212,8 @@ paths: summary: Returns addresses associated with a person. parameters: - $ref: "#/components/parameters/hmppsId" - - $ref: "#/components/parameters/Page" - - $ref: "#/components/parameters/PerPage" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/perPage" responses: "200": description: Successfully found a person with the provided HMPPS ID. @@ -260,8 +260,8 @@ paths: Prison systems record only custodial sentences, while Probation systems record only the main offence and some additional offences for case management purposes. Other offences recorded by HMCTS and police may not be included. parameters: - $ref: "#/components/parameters/hmppsId" - - $ref: "#/components/parameters/Page" - - $ref: "#/components/parameters/PerPage" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/perPage" responses: "200": description: Successfully found offences for a person with the provided HMPPS ID. @@ -304,8 +304,8 @@ paths: summary: Returns alerts associated with a person. parameters: - $ref: "#/components/parameters/hmppsId" - - $ref: "#/components/parameters/Page" - - $ref: "#/components/parameters/PerPage" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/perPage" responses: "200": description: Successfully found alerts for a person with the provided HMPPS ID. @@ -348,8 +348,8 @@ paths: summary: Returns alerts associated with a person. parameters: - $ref: "#/components/parameters/hmppsId" - - $ref: "#/components/parameters/Page" - - $ref: "#/components/parameters/PerPage" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/perPage" responses: "200": description: Successfully found alerts for a person with the provided HMPPS ID. @@ -391,8 +391,8 @@ paths: summary: Returns sentences associated with a person. parameters: - $ref: "#/components/parameters/hmppsId" - - $ref: "#/components/parameters/Page" - - $ref: "#/components/parameters/PerPage" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/perPage" responses: "200": description: Successfully found sentences for a person with the provided HMPPS ID. @@ -470,8 +470,8 @@ paths: summary: Returns risk scores from the last year associated with a person. parameters: - $ref: "#/components/parameters/hmppsId" - - $ref: "#/components/parameters/Page" - - $ref: "#/components/parameters/PerPage" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/perPage" responses: "200": description: Successfully found risk scores for a person with the provided HMPPS ID. @@ -970,15 +970,7 @@ components: required: true schema: type: string - Id: - name: Id - description: An Id (TBC), potentially Case Reference Number (CRN) - example: X00001 - in: path - required: true - schema: - type: string - Page: + page: name: page in: query schema: @@ -987,7 +979,7 @@ components: default: 1 required: false description: The page number (starting from 1) - PerPage: + perPage: name: perPage in: query schema: