Skip to content

Commit f2f80db

Browse files
committed
update generate
1 parent 9752419 commit f2f80db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

generate/generate.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ replace_from_dict_method() {
105105
local filename=$2
106106
sed "s/return cls\.from_dict(json\.loads(json_str))/result = cls.from_dict(json.loads(json_str))\\n if result.type != \"$type_value\": raise ValueError(\"Invalid type\")\\n return result/" out/openapi_client/models/${filename} --in-place
107107
}
108-
108+
# `from_dict`メソッドで`oneOf`に該当するスキーマが複数見つかる場合はErrorが発生する
109+
# その場合は、`type`の値を判定するようにした
109110
replace_from_dict_method Movie system_metadata_movie.py
110111
replace_from_dict_method Image system_metadata_image.py
111112
replace_from_dict_method Custom system_metadata_custom.py
@@ -117,6 +118,7 @@ replace_from_dict_method SegmentationV2 full_annotation_data_segmentation_v2.py
117118
cp out/openapi_client/models/*.py ../annofabapi/pydantic_models
118119
rm -Rf out/openapi_client
119120

121+
120122
DOCKER_IMAGE=openapitools/openapi-generator-cli:v4.3.1
121123
docker run --rm -u `id -u`:`id -g` -v ${PWD}:/local -w /local -e JAVA_OPTS=${JAVA_OPTS} ${DOCKER_IMAGE} generate \
122124
--input-spec swagger/swagger-models.yaml \

0 commit comments

Comments
 (0)