Skip to content

Commit

Permalink
Adding annotated from main.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysrevans3 committed Aug 20, 2024
1 parent 14d18f9 commit 0c5de64
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions stac_fastapi/types/stac_fastapi/types/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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)

0 comments on commit 0c5de64

Please sign in to comment.