mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-06 10:42:39 +00:00
Use ruamel.yaml to format the OpenAPI spec
This commit is contained in:
parent
41749944a5
commit
60fcc2f557
3 changed files with 6201 additions and 6223 deletions
|
@ -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)
|
||||
|
|
|
@ -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
Loading…
Add table
Add a link
Reference in a new issue