Skip to content

Commit 5441801

Browse files
committed
Add snake_case generation
1 parent eead9d7 commit 5441801

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

scripts/generate_types.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ uv run datamodel-codegen \
3333
--class-name A2A \
3434
--use-standard-collections \
3535
--use-subclass-enum \
36-
--base-class a2a._base.A2ABaseModel
36+
--base-class a2a._base.A2ABaseModel \
37+
--snake-case-field
3738

3839
echo "Formatting generated file with ruff..."
3940
uv run ruff format "$GENERATED_FILE"

src/a2a/_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ class A2ABaseModel(BaseModel):
1212
# SEE: https://docs.pydantic.dev/latest/api/config/#pydantic.config.ConfigDict.populate_by_name
1313
validate_by_name=True,
1414
validate_by_alias=True,
15+
serialize_by_alias=True,
1516
)

0 commit comments

Comments
 (0)