From d04ea8ad8aeecb7bb1333ac8d09232649d013484 Mon Sep 17 00:00:00 2001 From: Ben Church Date: Wed, 22 Jan 2025 09:29:37 -0800 Subject: [PATCH] ci: fix pydantic v2 model gen by explicitly mark input files as jsonschema (#108) --- protocol-models/bin/generate-python-dataclasses.sh | 1 + protocol-models/bin/generate-python-pydantic-v2.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/protocol-models/bin/generate-python-dataclasses.sh b/protocol-models/bin/generate-python-dataclasses.sh index 3dbda7e..1bd230e 100755 --- a/protocol-models/bin/generate-python-dataclasses.sh +++ b/protocol-models/bin/generate-python-dataclasses.sh @@ -27,6 +27,7 @@ for f in "$ROOT_DIR/$YAML_DIR"/*.yaml; do echo "from .$filename_wo_ext import *" >> "$ROOT_DIR/$OUTPUT_DIR"/__init__.py datamodel-codegen \ + --input-file-type jsonschema \ --input "$ROOT_DIR/$YAML_DIR/$filename_wo_ext.yaml" \ --output "$ROOT_DIR/$OUTPUT_DIR/$filename_wo_ext.py" \ --output-model-type dataclasses.dataclass \ diff --git a/protocol-models/bin/generate-python-pydantic-v2.sh b/protocol-models/bin/generate-python-pydantic-v2.sh index 53ffd3f..952c0d9 100755 --- a/protocol-models/bin/generate-python-pydantic-v2.sh +++ b/protocol-models/bin/generate-python-pydantic-v2.sh @@ -27,6 +27,7 @@ for f in "$ROOT_DIR/$YAML_DIR"/*.yaml; do echo "from .$filename_wo_ext import *" >> "$ROOT_DIR/$OUTPUT_DIR"/__init__.py datamodel-codegen \ + --input-file-type jsonschema \ --input "$ROOT_DIR/$YAML_DIR/$filename_wo_ext.yaml" \ --output "$ROOT_DIR/$OUTPUT_DIR/$filename_wo_ext.py" \ --output-model-type pydantic_v2.BaseModel \