Skip to content

Commit 0f3d385

Browse files
committed
Update ADR
1 parent 12ed4f6 commit 0f3d385

File tree

2 files changed

+17
-3239
lines changed

2 files changed

+17
-3239
lines changed

docs/adr/0011-openapi-revision.md

+17-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
# 0011 - Revert decision 0003 and auto-generate OpenAPI specification
22

3-
2024-08-14
3+
2024-08-16
44

55
## Status
66

77
Proposed
88

99
## Context
1010

11-
In [#0003](./0003-manually-manage-openapi-file.md), the team decided to write OpenAPI specifications by hand. This went
12-
against the way other HMPPS usually do this, but had the benefit of being able to write documentation for endpoints
13-
before they have been built.
14-
15-
...
11+
In [#0003](./0003-manually-manage-openapi-file.md), the team decided to manually manage the OpenAPI specification file, as opposed to generating them from code.
12+
This had the benefit of allowing the team to write documentation for endpoints before they have been built.
13+
However, in practice this has resulted in an out-of-date specification due to code changes not being reflected.
1614

1715
## Decision
1816

19-
...
17+
Revert decision 0003 and auto-generate OpenAPI specification using the [Springdoc OpenAPI library](https://springdoc.org).
18+
When the code or annotations change, the OpenAPI specification will be generated and published automatically.
19+
Additional documentation can be added for endpoints that have not yet been implemented, by adding a separate "draft" OpenAPI specification file.
20+
21+
### Rationale
22+
* Auto-generating OpenAPI specifications from annotations in code is consistent with the wider HMPPS approach
23+
* Keeping documentation as close to the relevant code as possible ensures it is kept up-to-date
24+
* Pre-existing documentation is maintained
25+
* Additional documentation that doesn't correspond to code can be drafted separately
26+
27+
## Consequences
28+
* The existing OpenAPI yaml file will be converted into code annotations, and will be published automatically via GitHub pages.
29+
* The tech-docs pages will be updated to reference the new location.

0 commit comments

Comments
 (0)