Commit 94eed94
committed
LEGLINK-887: Terminology FHIR endpoints return Problem Details on error
FhirController answered every error with a bare string body and text/plain, so a
rejected request carried no type, title, status or traceId. LEGLINK-886 corrected the
status code for a request naming no value set, but the payload was still a plain
string; this makes the body match the RFC 9457 format ConfigController has returned
since LEGLINK-591.
- Adds TerminologyProblem plus BadRequestProblem, NotFoundProblem and
InternalServerErrorProblem helpers, and routes all 13 error returns across the six
actions through them (7 BadRequest, 3 NotFound, 3 raw 500).
- traceId comes from the existing AddTerminologyProblemDetails customization.
- detail is prose, so the helper appends a terminating period. Exception messages stay
fragments because they are also read from logs and asserted in unit tests.
- 500 responses no longer place the exception message in the body; the customization
substitutes a generic detail so internal state is not exposed to the caller.
Testing: 73 unit tests pass in UnitTests.Terminology, one new covering LEGLINK-887's
reported request (empty valueUri in the POST body). Verified against the local
docker-compose stack that an empty valueUri in the body, an empty url query parameter,
a markup-only display and an unknown ValueSet id all return application/problem+json
carrying type, title, status, detail and a W3C traceId, and that the $validate-code
success and failure payloads are unchanged.1 parent 3c957dd commit 94eed94
2 files changed
Lines changed: 87 additions & 21 deletions
File tree
- DotNet
- ServiceTests/UnitTests/Terminology/Controllers
- Terminology/Controllers
Lines changed: 40 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
56 | 77 | | |
57 | 78 | | |
58 | 79 | | |
| |||
99 | 120 | | |
100 | 121 | | |
101 | 122 | | |
102 | | - | |
103 | | - | |
| 123 | + | |
104 | 124 | | |
105 | 125 | | |
106 | 126 | | |
| |||
116 | 136 | | |
117 | 137 | | |
118 | 138 | | |
119 | | - | |
120 | | - | |
| 139 | + | |
121 | 140 | | |
122 | 141 | | |
123 | 142 | | |
| |||
127 | 146 | | |
128 | 147 | | |
129 | 148 | | |
130 | | - | |
131 | | - | |
| 149 | + | |
132 | 150 | | |
133 | 151 | | |
134 | 152 | | |
| |||
138 | 156 | | |
139 | 157 | | |
140 | 158 | | |
141 | | - | |
142 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
143 | 175 | | |
144 | 176 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
57 | 91 | | |
58 | 92 | | |
59 | 93 | | |
| |||
75 | 109 | | |
76 | 110 | | |
77 | 111 | | |
78 | | - | |
| 112 | + | |
79 | 113 | | |
80 | 114 | | |
81 | 115 | | |
82 | | - | |
| 116 | + | |
83 | 117 | | |
84 | 118 | | |
85 | 119 | | |
| |||
105 | 139 | | |
106 | 140 | | |
107 | 141 | | |
108 | | - | |
| 142 | + | |
109 | 143 | | |
110 | 144 | | |
111 | 145 | | |
112 | | - | |
| 146 | + | |
113 | 147 | | |
114 | 148 | | |
115 | 149 | | |
| |||
134 | 168 | | |
135 | 169 | | |
136 | 170 | | |
137 | | - | |
| 171 | + | |
138 | 172 | | |
139 | 173 | | |
140 | 174 | | |
141 | | - | |
| 175 | + | |
142 | 176 | | |
143 | 177 | | |
144 | 178 | | |
145 | | - | |
| 179 | + | |
146 | 180 | | |
147 | 181 | | |
148 | 182 | | |
| |||
168 | 202 | | |
169 | 203 | | |
170 | 204 | | |
171 | | - | |
| 205 | + | |
172 | 206 | | |
173 | 207 | | |
174 | 208 | | |
175 | | - | |
| 209 | + | |
176 | 210 | | |
177 | 211 | | |
178 | 212 | | |
| |||
198 | 232 | | |
199 | 233 | | |
200 | 234 | | |
201 | | - | |
| 235 | + | |
202 | 236 | | |
203 | 237 | | |
204 | 238 | | |
205 | | - | |
| 239 | + | |
206 | 240 | | |
207 | 241 | | |
208 | 242 | | |
| |||
235 | 269 | | |
236 | 270 | | |
237 | 271 | | |
238 | | - | |
| 272 | + | |
239 | 273 | | |
240 | 274 | | |
241 | 275 | | |
| |||
271 | 305 | | |
272 | 306 | | |
273 | 307 | | |
274 | | - | |
| 308 | + | |
275 | 309 | | |
276 | 310 | | |
277 | 311 | | |
| |||
0 commit comments