Home / Function/ test_pydantic_model_serialization() — anthropic-sdk-python Function Reference

test_pydantic_model_serialization() — anthropic-sdk-python Function Reference

Architecture documentation for the test_pydantic_model_serialization() function in test_json.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  744fbfe8_c33c_2c29_14d5_4dacc69a5d66["test_pydantic_model_serialization()"]
  daa75f9a_3892_38ac_4897_b274c540a548["TestOpenapiDumps"]
  744fbfe8_c33c_2c29_14d5_4dacc69a5d66 -->|defined in| daa75f9a_3892_38ac_4897_b274c540a548
  style 744fbfe8_c33c_2c29_14d5_4dacc69a5d66 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_utils/test_json.py lines 24–33

    def test_pydantic_model_serialization(self) -> None:
        class User(pydantic.BaseModel):
            first_name: str
            last_name: str
            age: int

        model_instance = User(first_name="John", last_name="Kramer", age=83)
        data = {"model": model_instance}
        json_bytes = openapi_dumps(data)
        assert json_bytes == b'{"model":{"first_name":"John","last_name":"Kramer","age":83}}'

Subdomains

Frequently Asked Questions

What does test_pydantic_model_serialization() do?
test_pydantic_model_serialization() is a function in the anthropic-sdk-python codebase, defined in tests/test_utils/test_json.py.
Where is test_pydantic_model_serialization() defined?
test_pydantic_model_serialization() is defined in tests/test_utils/test_json.py at line 24.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free