Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardising open api #439

Merged
merged 2 commits into from
Jun 7, 2024
Merged
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
94 changes: 43 additions & 51 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -127,9 +127,9 @@ 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/Page"
- $ref: "#/components/parameters/PerPage"
- $ref: "#/components/parameters/hmppsId"
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/perPage"
responses:
"200":
description: >
Expand Down Expand Up @@ -211,9 +211,9 @@ paths:
- persons
summary: Returns addresses associated with a person.
parameters:
- $ref: "#/components/parameters/HmppsId"
- $ref: "#/components/parameters/Page"
- $ref: "#/components/parameters/PerPage"
- $ref: "#/components/parameters/hmppsId"
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/perPage"
responses:
"200":
description: Successfully found a person with the provided HMPPS ID.
Expand Down Expand Up @@ -259,9 +259,9 @@ 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/Page"
- $ref: "#/components/parameters/PerPage"
- $ref: "#/components/parameters/hmppsId"
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/perPage"
responses:
"200":
description: Successfully found offences for a person with the provided HMPPS ID.
Expand Down Expand Up @@ -303,9 +303,9 @@ paths:
- alerts
summary: Returns alerts associated with a person.
parameters:
- $ref: "#/components/parameters/HmppsId"
- $ref: "#/components/parameters/Page"
- $ref: "#/components/parameters/PerPage"
- $ref: "#/components/parameters/hmppsId"
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/perPage"
responses:
"200":
description: Successfully found alerts for a person with the provided HMPPS ID.
Expand Down Expand Up @@ -347,9 +347,9 @@ paths:
- alerts
summary: Returns alerts associated with a person.
parameters:
- $ref: "#/components/parameters/HmppsId"
- $ref: "#/components/parameters/Page"
- $ref: "#/components/parameters/PerPage"
- $ref: "#/components/parameters/hmppsId"
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/perPage"
responses:
"200":
description: Successfully found alerts for a person with the provided HMPPS ID.
Expand Down Expand Up @@ -390,9 +390,9 @@ paths:
- persons
summary: Returns sentences associated with a person.
parameters:
- $ref: "#/components/parameters/HmppsId"
- $ref: "#/components/parameters/Page"
- $ref: "#/components/parameters/PerPage"
- $ref: "#/components/parameters/hmppsId"
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/perPage"
responses:
"200":
description: Successfully found sentences for a person with the provided HMPPS ID.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -469,9 +469,9 @@ paths:
- risks
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/hmppsId"
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/perPage"
responses:
"200":
description: Successfully found risk scores for a person with the provided HMPPS ID.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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:
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -962,23 +962,15 @@ paths:
$ref: "#/components/examples/InternalServerError"
components:
parameters:
HmppsId:
hmppsId:
name: hmppsId
description: A URL-encoded HMPPS identifier
example: 2008%2F0545166T
in: path
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:
Expand All @@ -987,7 +979,7 @@ components:
default: 1
required: false
description: The page number (starting from 1)
PerPage:
perPage:
name: perPage
in: query
schema:
Expand Down
Loading