Commit c86e6a0
fix: look up OpenAPI response definition by string status code
router:get-content-type-for-code indexed the string-keyed responses map
(parsed from the OpenAPI JSON, so keys are "200", "404", "default") with
the integer status $code. That only ever matched because of eXist's
pre-conformance map-key coercion, which cast the integer lookup key to
the map's string keyType. eXist-db/exist#6491 makes map keys compare by
op:same-key per XQuery 3.1 section 17.1 (no cross-family coercion), so an
integer key no longer matches a string key: the lookup misses, falls back
to the "application/xml" content type, and a JSON response is serialized
as XML (SENR0001) on the forward-dispatch path.
Look up by string($code) instead. This is correct independent of #6491 -
the OpenAPI keys are strings - and works on both current and pre-#6491
eXist (string-to-string always matched).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent c9ef86b commit c86e6a0
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
333 | 336 | | |
334 | 337 | | |
335 | 338 | | |
| |||
0 commit comments