1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-openapi synced 2026-01-11 23:50:26 +01:00

update build script

Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2024-02-19 12:26:37 +09:00
parent af5875b4e3
commit 4712717f12
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA
4 changed files with 3 additions and 27 deletions

View file

@ -1,4 +1,4 @@
inputSpec: dist/compatible/openapi-3.0.yaml
inputSpec: dist/compatible_discriminator/openapi-3.0.yaml
outputDir: python_generated
useOneOfDiscriminatorLookup: true

View file

@ -1,23 +0,0 @@
import glob
for file in glob.glob("python_generated/openapi_client/models/*.py"):
with open(file, "r") as f:
text = f.read()
indent = " "
text = text.replace(
f"{indent}{indent}try:",
f"{indent}{indent}if match == 0:",
)
text = text.replace(
f"{indent}{indent}except (ValidationError, ValueError) as e:",
f"{indent}{indent}else:",
)
text = text.replace(
f"{indent}{indent}{indent}error_messages.append(str(e))",
f"{indent}{indent}{indent}pass",
)
with open(file, "w") as f:
f.write(text)