chore: improve extract json script

This commit is contained in:
Matthias 2024-07-28 15:33:21 +02:00
parent 1226593f3b
commit 2fd6c962d2
2 changed files with 17 additions and 10 deletions

View File

@ -0,0 +1,17 @@
"""Script to extract the configuration json schema from config_schema.py file."""
from pathlib import Path
import rapidjson
from freqtrade.configuration.config_schema import CONF_SCHEMA
def extract_config_json_schema():
schema_filename = Path(__file__).parent / "schema.json"
with schema_filename.open("w") as f:
rapidjson.dump(CONF_SCHEMA, f, indent=2)
if __name__ == "__main__":
extract_config_json_schema()

View File

@ -1,10 +0,0 @@
from pathlib import Path
import rapidjson
from freqtrade.configuration.config_schema import CONF_SCHEMA
schema_filename = Path(__file__).parent / "schema.json"
with schema_filename.open("w") as f:
rapidjson.dump(CONF_SCHEMA, f, indent=2)