From 0c5de643a301619d4a2c87eb49048ed0061d9ff0 Mon Sep 17 00:00:00 2001 From: rhysrevans3 Date: Tue, 20 Aug 2024 14:30:07 +0100 Subject: [PATCH] Adding annotated from main. --- stac_fastapi/types/stac_fastapi/types/transaction.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stac_fastapi/types/stac_fastapi/types/transaction.py b/stac_fastapi/types/stac_fastapi/types/transaction.py index a7f8cf25..e49a7d5c 100644 --- a/stac_fastapi/types/stac_fastapi/types/transaction.py +++ b/stac_fastapi/types/stac_fastapi/types/transaction.py @@ -6,6 +6,7 @@ from fastapi import Body from pydantic import BaseModel from stac_pydantic import Collection, Item, ItemCollection +from typing_extensions import Annotated from stac_fastapi.api.models import CollectionUri, ItemUri @@ -14,14 +15,14 @@ class PostItem(CollectionUri): """Create Item.""" - item: Union[Item, ItemCollection] = attr.ib(default=Body(None)) + item: Annotated[Union[Item, ItemCollection], Body()] = attr.ib(default=None) @attr.s class PutPatchItem(ItemUri): """Update Item.""" - item: Item = attr.ib(default=Body(None)) + item: Annotated[Item, Body()] = attr.ib(default=None) @attr.s @@ -62,4 +63,4 @@ def __init__(self, *args, **kwargs): class PutPatchCollection(CollectionUri): """Update Collection.""" - collection: Collection = attr.ib(default=Body(None)) + collection: Annotated[Collection, Body()] = attr.ib(default=None)