Skip to content

Commit 4396201

Browse files
committed
write schema to sphinx to make it usable in editors
1 parent 09aef9a commit 4396201

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ build:
2424
- uv sync --group dev --group rtd
2525
pre_build:
2626
- ./fetch_swagger.sh
27-
- uv run generate-schema.py
27+
- uv run generate-schema.py -o > docs/_static/schema.json
2828
build:
2929
html:
3030
- uv run sphinx-build -T -b html docs/ $READTHEDOCS_OUTPUT/html

generate-schema.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,7 @@ def generate_openapi_schema(
6767
fh.write(swagger_js)
6868

6969
if args.output:
70-
print(json.dumps(openapi, indent=4, sort_keys=True))
70+
schema = TutorialModel.model_json_schema()
71+
del schema["properties"]["path"]
72+
schema["required"].remove("path")
73+
print(json.dumps(schema, indent=4, sort_keys=True))

0 commit comments

Comments
 (0)