feat(api): sort openapi schemas

Reduces the constant changes to the frontend client types due to inconsistent ordering of pydantic models.
This commit is contained in:
psychedelicious
2024-05-29 21:00:02 +10:00
parent 5a4d10467b
commit 5beec8211a
2 changed files with 8 additions and 4 deletions

View File

@ -108,6 +108,8 @@ def get_openapi_func(
if post_transform is not None:
openapi_schema = post_transform(openapi_schema)
openapi_schema["components"]["schemas"] = dict(sorted(openapi_schema["components"]["schemas"].items()))
app.openapi_schema = openapi_schema
return app.openapi_schema