From 812cf277b8097e9ab7326ef8568879f3e306fae0 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Mon, 1 Apr 2024 18:20:45 +1100 Subject: [PATCH] feat(api): sort socket event names for openapi schema Deterministic ordering prevents extraneous, non-functional changes to the autogenerated types --- invokeai/app/api_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invokeai/app/api_app.py b/invokeai/app/api_app.py index e01742a4e9..c8985eb3df 100644 --- a/invokeai/app/api_app.py +++ b/invokeai/app/api_app.py @@ -184,7 +184,7 @@ def custom_openapi() -> dict[str, Any]: invoker_schema["class"] = "invocation" # Add all pydantic event schemas registered with fastapi-events - for event in EventBase.get_events(): + for event in sorted(EventBase.get_events(), key=lambda e: e.__name__): json_schema = event.model_json_schema(mode="serialization", ref_template="#/components/schemas/{model}") if "$defs" in json_schema: for schema_key, schema in json_schema["$defs"].items():