diff --git a/src/adapter/inbound/web-advanced/src/main/java/dev/caskeleton/adapter/inbound/web/advanced/codec/WebXmlMapperFactory.java b/src/adapter/inbound/web-advanced/src/main/java/dev/caskeleton/adapter/inbound/web/advanced/codec/WebXmlMapperFactory.java index ee36dbc9..f53b752f 100644 --- a/src/adapter/inbound/web-advanced/src/main/java/dev/caskeleton/adapter/inbound/web/advanced/codec/WebXmlMapperFactory.java +++ b/src/adapter/inbound/web-advanced/src/main/java/dev/caskeleton/adapter/inbound/web/advanced/codec/WebXmlMapperFactory.java @@ -77,6 +77,15 @@ public final class WebXmlMapperFactory { return XmlMapper.builder(factory) .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .disable(MapperFeature.ALLOW_COERCION_OF_SCALARS) + // Deliberately NOT the CBOR mapper's withCoercionConfig(String->Fail, Textual Integer->Fail). + // XML is a textual format: every scalar — a numeric or boolean DTO field included — arrives + // as a String token (5). Forbidding String-shaped input there would reject all + // numeric/boolean binding, and WebCodecMapperTest.xmlRoundTripPreservesWireTypes (which binds + // `int count`) pins exactly that. The parity a reader might expect with the CBOR profile is + // not a strictness bypass: FAIL_ON_UNKNOWN_PROPERTIES and the SecureXmlInputFactory hardening + // apply here too, @Valid constraints run post-binding on every representation, and binding + // "5"->int is XML's normal semantics, not the type confusion the CBOR lockdown guards against. + // (W4 red team BE-INPUT-001: the divergence is by design, not an omission.) .build(); }