Skip to content

Commit 72f3300

Browse files
docs: update CLI reference documentation and prompt data
🤖 Generated by GitHub Actions
1 parent 73bf200 commit 72f3300

2 files changed

Lines changed: 17 additions & 12 deletions

File tree

docs/cli-reference/typing-customization.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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
)

src/datamodel_code_generator/prompt_data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"--aliases": "Apply custom field and class name aliases from JSON file.",
1212
"--all-exports-collision-strategy": "Handle name collisions when exporting recursive module hierarchies.",
1313
"--all-exports-scope": "Generate __all__ exports for child modules in __init__.py files.",
14+
"--allof-class-hierarchy": "Controls how allOf schemas are represented in the generated class hierarchy.",
1415
"--allof-merge-mode": "Merge constraints from root model references in allOf schemas.",
1516
"--allow-extra-fields": "Allow extra fields in generated Pydantic models (extra='allow').",
1617
"--allow-population-by-field-name": "Allow Pydantic model population by field name (not just alias).",

0 commit comments

Comments
 (0)