better add_search typing

This commit is contained in:
Laura Klünder 2024-12-03 19:04:18 +01:00
parent b96707d426
commit b96dcb9b50

View file

@ -113,14 +113,9 @@ class LocationSchema(WithAccessRestrictionSchema, TitledSchema, LocationSlugSche
title="can describe locations", title="can describe locations",
description="if `true`, this object can be used to describe other locations (e.g. in their subtitle)", description="if `true`, this object can be used to describe other locations (e.g. in their subtitle)",
) )
add_search: Union[ add_search: str = APIField(
Annotated[str, APIField(title="search terms", description="set when looking for searchable locations")],
Annotated[None, APIField(title="null", description="when not looking for searchable locations")],
] = APIField(
None,
title="additional search terms", title="additional search terms",
description="more data for the search index separated by spaces, " description="more data for the search index separated by spaces",
"only set when looking for searchable locations",
example="more search terms", example="more search terms",
) )