Example: Nested Pydantic models.
()
| 99 | |
| 100 | |
| 101 | def example_nested_models(): |
| 102 | """Example: Nested Pydantic models.""" |
| 103 | print("=== Nested Pydantic Models ===") |
| 104 | |
| 105 | user = User( |
| 106 | id=2, |
| 107 | name='Bob Johnson', |
| 108 | email='bob@example.com', |
| 109 | age=35, |
| 110 | active=True, |
| 111 | address=Address( |
| 112 | street='123 Main Street', |
| 113 | city='Boston', |
| 114 | state='MA', |
| 115 | zipcode='02101' |
| 116 | ) |
| 117 | ) |
| 118 | |
| 119 | toon = encode_pydantic(user) |
| 120 | print("TOON format:") |
| 121 | print(toon) |
| 122 | print() |
| 123 | |
| 124 | |
| 125 | def example_exclude_options(): |
no test coverage detected
searching dependent graphs…