File tree Expand file tree Collapse file tree 4 files changed +41
-46
lines changed
Expand file tree Collapse file tree 4 files changed +41
-46
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ codegen
2828coro
2929datamodel
3030dunders
31+ euo
3132genai
3233getkwargs
3334gle
Original file line number Diff line number Diff line change @@ -36,31 +36,10 @@ jobs:
3636 GENERATED_FILE="./src/a2a/types.py"
3737 echo "GENERATED_FILE=$GENERATED_FILE" >> "$GITHUB_OUTPUT"
3838
39- - name : Run datamodel-codegen
39+ - name : Generate types from schema
4040 run : |
41- set -euo pipefail # Exit immediately if a command exits with a non-zero status
42-
43- REMOTE_URL="https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/specification/json/a2a.json"
44- GENERATED_FILE="${{ steps.vars.outputs.GENERATED_FILE }}"
45-
46- echo "Running datamodel-codegen..."
47- uv run datamodel-codegen \
48- --url "$REMOTE_URL" \
49- --input-file-type jsonschema \
50- --output "$GENERATED_FILE" \
51- --target-python-version 3.10 \
52- --output-model-type pydantic_v2.BaseModel \
53- --disable-timestamp \
54- --use-schema-description \
55- --use-union-operator \
56- --use-field-description \
57- --use-default \
58- --use-default-kwarg \
59- --use-one-literal-as-default \
60- --class-name A2A \
61- --use-standard-collections \
62- --use-subclass-enum
63- echo "Codegen finished."
41+ chmod +x scripts/generate_types.sh
42+ ./scripts/generate_types.sh "${{ steps.vars.outputs.GENERATED_FILE }}"
6443
6544 - name : Install Buf
6645 uses : bufbuild/buf-setup-action@v1
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Exit immediately if a command exits with a non-zero status.
4+ # Treat unset variables as an error.
5+ set -euo pipefail
6+
7+ # Check if an output file path was provided as an argument.
8+ if [ -z " $1 " ]; then
9+ echo " Error: Output file path must be provided as the first argument." >&2
10+ exit 1
11+ fi
12+
13+ REMOTE_URL=" https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/specification/json/a2a.json"
14+ GENERATED_FILE=" $1 "
15+
16+ echo " Running datamodel-codegen..."
17+ echo " - Source URL: $REMOTE_URL "
18+ echo " - Output File: $GENERATED_FILE "
19+
20+ uv run datamodel-codegen \
21+ --url " $REMOTE_URL " \
22+ --input-file-type jsonschema \
23+ --output " $GENERATED_FILE " \
24+ --target-python-version 3.10 \
25+ --output-model-type pydantic_v2.BaseModel \
26+ --disable-timestamp \
27+ --use-schema-description \
28+ --use-union-operator \
29+ --use-field-description \
30+ --use-default \
31+ --use-default-kwarg \
32+ --use-one-literal-as-default \
33+ --class-name A2A \
34+ --use-standard-collections \
35+ --use-subclass-enum
36+
37+ echo " Codegen finished successfully."
You can’t perform that action at this time.
0 commit comments