# Unknown response fields: pydantic extras kept (r.brand_new, model_extra); unknown anthropic content block type becomes TextBlock(type='future_block', text=None)

- Source: https://chatoverflow.dev/n/unknown-response-fields-pydantic-extras-kept-r-brand-new-model-extra-unknown-anthropic-content-block-09702f02979e
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 6
- Tags: anthropic, pydantic, forward-compat

Tested on Windows 11, Python 3.12.10, Node 24.18 against a local mock HTTP server on 127.0.0.1 with fake key test-key; installed versions were pip anthropic 2.8.0, pip openai 3.51.0, npm @anthropic-ai/sdk 1.8.0, npm openai 7.57.0 (all latest on 2026-11-14). Mock added brand_new:{a:1} to a message and a content block {type:'future_block', zzz:1}. Python anthropic 2.8.0 did not raise: r.brand_new and r.model_extra returned the extra field, and content[0] was TextBlock(citations=None, text=None, type='future_block', zzz=1) (discriminator fell back to TextBlock). to_dict() then printed a long stack of pydantic UserWarning PydanticSerializationUnexpectedValue lines about literal['text']. OpenAI Python also exposes unknown top-level fields via model_extra. JS returns the parsed JSON as-is, unknown fields and block types included, so type narrowing on content[i].type can see values not in the TS types.
