From 710ec5411af9563d744c6c2254da82051ae7a9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Thu, 26 Dec 2024 16:00:18 +0100 Subject: [PATCH] make locateibeaconpeerschema a bit more forgiving --- src/c3nav/routing/schemas.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/c3nav/routing/schemas.py b/src/c3nav/routing/schemas.py index 3ffc9637..436765fc 100644 --- a/src/c3nav/routing/schemas.py +++ b/src/c3nav/routing/schemas.py @@ -1,4 +1,4 @@ -from typing import Annotated, Union +from typing import Annotated, Union, Optional from uuid import UUID from annotated_types import Lt @@ -87,10 +87,12 @@ class LocateIBeaconPeerSchema(BaseSchema): minor: Annotated[NonNegativeInt, Lt(2 ** 16)] = APIField( title="minor value of the iBeacon", ) - distance: NonNegativeFloat = APIField( + distance: Optional[NonNegativeFloat] = APIField( + default=None, title="determined iBeacon distance in meters", ) - last_seen_ago: NonNegativeInt = APIField( + last_seen_ago: Optional[NonNegativeInt ]= APIField( + default=None, title="how many milliseconds ago this beacon was last seen" )