mirror of
https://github.com/thegeneralist01/twitter-openapi
synced 2026-01-11 15:40:26 +01:00
update build script
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
parent
af5875b4e3
commit
4712717f12
4 changed files with 3 additions and 27 deletions
3
.vscode/launch.json
vendored
3
.vscode/launch.json
vendored
|
|
@ -28,7 +28,8 @@
|
|||
"env": {
|
||||
"ERROR_UNCATCHED": "True",
|
||||
"STRICT_MODE": "True",
|
||||
"MULTI_THREAD": "True"
|
||||
"MULTI_THREAD": "True",
|
||||
"CUESOR_TEST_COUNT": "3"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
2
.vscode/tasks.json
vendored
2
.vscode/tasks.json
vendored
|
|
@ -9,7 +9,6 @@
|
|||
"source .venv/bin/activate;",
|
||||
"python3 tools/build.py;",
|
||||
"java -jar openapi-generator-cli.jar generate -c test/python/openapi-generator-config.yaml -g python;",
|
||||
"python3 test/python/replace.py;",
|
||||
"python3 -m pip install ./python_generated;"
|
||||
]
|
||||
},
|
||||
|
|
@ -19,7 +18,6 @@
|
|||
"python tools/build.py;",
|
||||
"scoop reset temurin11-jdk;",
|
||||
"java -jar openapi-generator-cli.jar generate -c test/python/openapi-generator-config.yaml -g python;",
|
||||
"python test/python/replace.py;",
|
||||
"python -m pip install ./python_generated;"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
inputSpec: dist/compatible/openapi-3.0.yaml
|
||||
inputSpec: dist/compatible_discriminator/openapi-3.0.yaml
|
||||
outputDir: python_generated
|
||||
|
||||
useOneOfDiscriminatorLookup: true
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue