Skip to content

Commit 00d3e7f

Browse files
committed
PI-2509: Add ADR with rules for naming API endpoints
1 parent a2452b9 commit 00d3e7f

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

docs/adr/0012-endpoint-naming.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# 0012 - Endpoint Naming Strategy
2+
3+
2024-09-06
4+
5+
## Status
6+
7+
Proposed
8+
9+
## Context
10+
11+
The HMPPS Integration API is intended as a general method of providing data interfaces to HMPPS digital services. The HTTP endpoints are partitioned using the internal HMPPS domain model and provide data on these areas of the criminal justice domain. In most cases access to a subset of the general endpoints should be sufficient to provide a client with a suitable data interface to HMPPS systems and this is expected to be the normal operating model. In some cases it may be necessary to partition the data in different ways for a specific client. This may be for security, performance or other technical reasons. The API infrastructure and development process supports providing these extra endpoints on a client-specific basis. We would like to ensure the integration design and documentation is consistent and clear with rules for naming both general and specific endpoints. This should aid ongoing development of the API and help both API management teams and clients understand which endpoints are generic and which are intended as client-specific.
12+
13+
## Decision
14+
15+
Name HTTP URLs according to the following rules:
16+
17+
1. Follow the [ADR documented](./0007-version-through-url-path.md) strategy for versioning in the URL path
18+
2. For client-specific endpoints use the URL path part immediately after the version part to indicate the specific client
19+
2. Use subsequent URL path parts to either:
20+
1. Indicate the HMPPS domain that the endpoint relates
21+
2. **OR** indicate the intention of a client-specific endpoints
22+
23+
### Rationale
24+
25+
* The URL path should indicate the overall intention of the HTTP endpoint
26+
* The URL path should indicate if the endpoint is intended for a specific client immediately after the version path part, supporting grouping of domain endpoints and client-specific endpoints in the documentation
27+
28+
## Consequences
29+
30+
* Developers of future endpoints will have a clear guidance on naming HTTP URLs to reflect the intention of the endpoint
31+
* General domain-based endpoints will be named in a clear and consistent manner
32+
* Client-specific endpoints will be named in a clear and consistent manner, indicating the client the endpoint has been designed for
33+
34+
## Examples
35+
36+
| Type | Description | URL Path |
37+
|-----------------|-------------------------------------------------------------------------------------------------|--------------------------------------------------|
38+
| HMPPS Domain | An endpoint that provides a persons cell location | `/v1/persons/{encodedHmppsId}/cell-location` |
39+
| HMPPS Domain | An endpoint that provides risk assessment actuarial scores | `/v1/persons/{encodedHmppsId}/risks/scores` |
40+
| Client-Specific | An endpoint to provide consolidated person details to support the EPF digital service | `/v1/epf/person-details/{encodedHmppsId}/{eventNumber}` |

0 commit comments

Comments
 (0)