From 180c5f0e72380d260eafaa508e8f0b4bfd9a0aed Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:42:58 +0100 Subject: [PATCH] linter happy --- .../src/models_library/rest_ordering.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/models-library/src/models_library/rest_ordering.py b/packages/models-library/src/models_library/rest_ordering.py index b042950c352..faac153400a 100644 --- a/packages/models-library/src/models_library/rest_ordering.py +++ b/packages/models-library/src/models_library/rest_ordering.py @@ -16,14 +16,17 @@ class OrderDirection(str, Enum): class OrderBy(BaseModel): # Based on https://google.aip.dev/132#ordering - field: IDStr = Field(..., description="field name identifier") - direction: OrderDirection = Field( - default=OrderDirection.ASC, - description=( - f"As [A,B,C,...] if `{OrderDirection.ASC.value}`" - f" or [Z,Y,X, ...] if `{OrderDirection.DESC.value}`" + field: Annotated[IDStr, Field(..., description="field name identifier")] + direction: Annotated[ + OrderDirection, + Field( + default=OrderDirection.ASC, + description=( + f"As [A,B,C,...] if `{OrderDirection.ASC.value}`" + f" or [Z,Y,X, ...] if `{OrderDirection.DESC.value}`" + ), ), - ) + ] class _BaseOrderQueryParams(RequestParameters):