From 7b02748af42287f78bbf3117f579078345439d88 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 25 Mar 2026 13:12:04 -0500 Subject: [PATCH] Explain `code` being splatted See https://github.com/element-hq/matrix-authentication-service/pull/5553#discussion_r2984636426 --- crates/policy/src/model.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/policy/src/model.rs b/crates/policy/src/model.rs index 8ba780297..a3bf24b5f 100644 --- a/crates/policy/src/model.rs +++ b/crates/policy/src/model.rs @@ -82,6 +82,10 @@ pub struct Violation { pub redirect_uri: Option, pub field: Option, + // We flatten as policies expect `code` as another top-level field. + // + // This also means all of the extra fields from the variant will be splatted at this + // level which is fine (arbitrary). #[serde(flatten)] pub variant: Option, }