@@ -122,37 +122,57 @@ class CoreConfig(TypedDict, total=False):
122
122
123
123
124
124
class SerializationInfo (Protocol [ContextT ]):
125
+ """Extra data used during serialization."""
126
+
125
127
@property
126
- def include (self ) -> IncExCall : ...
128
+ def include (self ) -> IncExCall :
129
+ """The `include` argument set during serialization."""
130
+ ...
127
131
128
132
@property
129
- def exclude (self ) -> IncExCall : ...
133
+ def exclude (self ) -> IncExCall :
134
+ """The `exclude` argument set during serialization."""
135
+ ...
130
136
131
137
@property
132
138
def context (self ) -> ContextT :
133
- """Current serialization context."""
139
+ """The current serialization context."""
134
140
...
135
141
136
142
@property
137
- def mode (self ) -> str : ...
143
+ def mode (self ) -> Literal ['python' , 'json' ]:
144
+ """The serialization mode set during serialization."""
145
+ ...
138
146
139
147
@property
140
- def by_alias (self ) -> bool : ...
148
+ def by_alias (self ) -> bool :
149
+ """The `by_alias` argument set during serialization."""
150
+ ...
141
151
142
152
@property
143
- def exclude_unset (self ) -> bool : ...
153
+ def exclude_unset (self ) -> bool :
154
+ """The `exclude_unset` argument set during serialization."""
155
+ ...
144
156
145
157
@property
146
- def exclude_defaults (self ) -> bool : ...
158
+ def exclude_defaults (self ) -> bool :
159
+ """The `exclude_defaults` argument set during serialization."""
160
+ ...
147
161
148
162
@property
149
- def exclude_none (self ) -> bool : ...
163
+ def exclude_none (self ) -> bool :
164
+ """The `exclude_none` argument set during serialization."""
165
+ ...
150
166
151
167
@property
152
- def serialize_as_any (self ) -> bool : ...
168
+ def serialize_as_any (self ) -> bool :
169
+ """The `serialize_as_any` argument set during serialization."""
170
+ ...
153
171
154
172
@property
155
- def round_trip (self ) -> bool : ...
173
+ def round_trip (self ) -> bool :
174
+ """The `round_trip` argument set during serialization."""
175
+ ...
156
176
157
177
def mode_is_json (self ) -> bool : ...
158
178
@@ -162,18 +182,20 @@ def __repr__(self) -> str: ...
162
182
163
183
164
184
class FieldSerializationInfo (SerializationInfo [ContextT ], Protocol ):
185
+ """Extra data used during field serialization."""
186
+
165
187
@property
166
- def field_name (self ) -> str : ...
188
+ def field_name (self ) -> str :
189
+ """The name of the current field being serialized."""
190
+ ...
167
191
168
192
169
193
class ValidationInfo (Protocol [ContextT ]):
170
- """
171
- Argument passed to validation functions.
172
- """
194
+ """Extra data used during validation."""
173
195
174
196
@property
175
197
def context (self ) -> ContextT :
176
- """Current validation context."""
198
+ """The current validation context."""
177
199
...
178
200
179
201
@property
0 commit comments