Use ruamel.yaml to format the OpenAPI spec

This commit is contained in:
Ashwin Bharambe 2025-01-28 10:17:28 -08:00
parent 41749944a5
commit 60fcc2f557
3 changed files with 6201 additions and 6223 deletions

View file

@ -14,7 +14,7 @@ from datetime import datetime
from pathlib import Path
import fire
import yaml
import ruamel.yaml as yaml
from llama_models import schema_utils
@ -61,7 +61,13 @@ def main(output_dir: str):
)
with open(output_dir / "llama-stack-spec.yaml", "w", encoding="utf-8") as fp:
yaml.dump(spec.get_json(), fp, allow_unicode=True)
y = yaml.YAML()
y.default_flow_style = False
y.block_seq_indent = 2
y.dump(
spec.get_json(),
fp,
)
with open(output_dir / "llama-stack-spec.html", "w") as fp:
spec.write_html(fp, pretty_print=True)

View file

@ -4781,6 +4781,9 @@
},
"enable_session_persistence": {
"type": "boolean"
},
"response_format": {
"$ref": "#/components/schemas/ResponseFormat"
}
},
"additionalProperties": false,

File diff suppressed because it is too large Load diff