Skip to content

Commit 269f2ab

Browse files
docs: clarify silent-drop behavior for typed AP schemas in if let Ok comment
"future-proofs" implied graceful handling; the comment now accurately notes that a type mismatch silently drops the entry, same as the catch-all arm. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 638fa84 commit 269f2ab

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.generator/src/generator/templates/model_simple.j2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ impl<'de> Deserialize<'de> for {{ name }} {
119119

120120
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
121121
{%- if additionalProperties != false and model.get("x-keep-typed-in-additional-properties") %}
122-
// from_value::<serde_json::Value> is infallible; the Ok guard future-proofs typed AP schemas.
122+
// from_value::<serde_json::Value> is infallible so Ok always fires;
123+
// for typed AP schemas a type mismatch silently drops the entry (same as the catch-all arm).
123124
if let Ok(ap_value) = serde_json::from_value(v.clone()) {
124125
additional_properties.insert(k.clone(), ap_value);
125126
}

0 commit comments

Comments
 (0)