@@ -293,23 +293,23 @@ even in multiple inheritance scenarios where two parent schemas define the same
293293
294294
295295 class Thing(Entity):
296- type: str
297- type_list: list[str]
296+ type: str | None = 'playground:Thing'
297+ type_list: list[str] | None = ['playground:Thing']
298298 name: constr(min_length=1) = Field(..., description='The things name')
299299
300300
301301 class Location(Entity2):
302- type: str
303- type_list: list[str]
302+ type: str | None = 'playground:Location'
303+ type_list: list[str] | None = ['playground:Location']
304304 address: constr(min_length=5) = Field(
305305 ..., description='The address of the location'
306306 )
307307
308308
309309 class Person(Thing, Location):
310310 name: constr(min_length=1) | None = Field(None, description="The person's name")
311- type: str
312- type_list: list[str]
311+ type: str | None = 'playground:Person'
312+ type_list: list[str] | None = ['playground:Person']
313313 ```
314314
315315 === "Without Option"
@@ -328,8 +328,12 @@ even in multiple inheritance scenarios where two parent schemas define the same
328328
329329 class Person(BaseModel):
330330 name: constr(min_length=1) = Field(..., description='The things name')
331- type: Any
332- type_list: list[Any]
331+ type: Any | None = 'playground:Location'
332+ type_list: list[Any] | None = [
333+ 'playground:Person',
334+ 'playground:Thing',
335+ 'playground:Location',
336+ ]
333337 address: constr(min_length=5) = Field(
334338 ..., description='The address of the location'
335339 )
@@ -346,14 +350,14 @@ even in multiple inheritance scenarios where two parent schemas define the same
346350
347351
348352 class Thing(Entity):
349- type: str
350- type_list: list[str]
353+ type: str | None = 'playground:Thing'
354+ type_list: list[str] | None = ['playground:Thing']
351355 name: constr(min_length=1) = Field(..., description='The things name')
352356
353357
354358 class Location(Entity2):
355- type: str
356- type_list: list[str]
359+ type: str | None = 'playground:Location'
360+ type_list: list[str] | None = ['playground:Location']
357361 address: constr(min_length=5) = Field(
358362 ..., description='The address of the location'
359363 )
0 commit comments