Skip to content

Commit 7e6cffb

Browse files
emmanuel-ferdmanpsychedelicious
authored andcommitted
fix: resolve FastAPI deprecation warning for example fields
Signed-off-by: Emmanuel Ferdman <[email protected]>
1 parent 5b187bc commit 7e6cffb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

invokeai/app/api/routers/images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ async def upload_image(
7272
resize_to: Optional[str] = Body(
7373
default=None,
7474
description=f"Dimensions to resize the image to, must be stringified tuple of 2 integers. Max total pixel count: {ResizeToDimensions.MAX_SIZE}",
75-
example='"[1024,1024]"',
75+
examples=['"[1024,1024]"'],
7676
),
7777
metadata: Optional[str] = Body(
7878
default=None,

invokeai/app/api/routers/model_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ async def get_hugging_face_models(
292292
)
293293
async def update_model_record(
294294
key: Annotated[str, Path(description="Unique key of model")],
295-
changes: Annotated[ModelRecordChanges, Body(description="Model config", example=example_model_input)],
295+
changes: Annotated[ModelRecordChanges, Body(description="Model config", examples=[example_model_input])],
296296
) -> AnyModelConfig:
297297
"""Update a model's config."""
298298
logger = ApiDependencies.invoker.services.logger
@@ -450,7 +450,7 @@ async def install_model(
450450
access_token: Optional[str] = Query(description="access token for the remote resource", default=None),
451451
config: ModelRecordChanges = Body(
452452
description="Object containing fields that override auto-probed values in the model config record, such as name, description and prediction_type ",
453-
example={"name": "string", "description": "string"},
453+
examples=[{"name": "string", "description": "string"}],
454454
),
455455
) -> ModelInstallJob:
456456
"""Install a model using a string identifier.

0 commit comments

Comments
 (0)