From 7eaf54131de6a60a59e121e566f5ad47b7dd3e30 Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:41:27 +0100 Subject: [PATCH] updates OAS --- api/specs/web-server/_users.py | 8 +- .../api/v0/openapi.yaml | 89 +++++++++++++++++-- 2 files changed, 88 insertions(+), 9 deletions(-) diff --git a/api/specs/web-server/_users.py b/api/specs/web-server/_users.py index 33b72d82e5f..586c5c3ddc0 100644 --- a/api/specs/web-server/_users.py +++ b/api/specs/web-server/_users.py @@ -15,8 +15,10 @@ MyTokenCreate, MyTokenGet, UserForAdminGet, + UserGet, UsersForAdminSearchQueryParams, UsersGetParams, + UsersSearch, ) from models_library.api_schemas_webserver.users_preferences import PatchRequestBody from models_library.generics import Envelope @@ -150,7 +152,7 @@ async def list_user_permissions(): @router.get( "/users/{user_id}", - response_model=Envelope[UserForAdminGet], + response_model=Envelope[UserGet], ) async def get_user(_path: Annotated[UsersGetParams, Depends()]): ... @@ -158,10 +160,10 @@ async def get_user(_path: Annotated[UsersGetParams, Depends()]): @router.post( "/users:search", - response_model=Envelope[list[UserForAdminGet]], + response_model=Envelope[list[UserGet]], description="Search among users who are publicly visible to the caller (i.e., me) based on their privacy settings.", ) -async def search_users(_body: Annotated[UsersForAdminSearchQueryParams, Depends()]): +async def search_users(_body: Annotated[UsersSearch, Depends()]): ... diff --git a/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml b/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml index 8585935a038..c9feff1f233 100644 --- a/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml +++ b/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml @@ -1344,7 +1344,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_UserForAdminGet_' + $ref: '#/components/schemas/Envelope_UserGet_' /v0/users:search: post: tags: @@ -1354,21 +1354,30 @@ paths: me) based on their privacy settings. operationId: search_users parameters: - - name: email + - name: match in: query required: true schema: type: string - minLength: 3 - maxLength: 200 - title: Email + minLength: 1 + maxLength: 80 + title: Match + - name: limit + in: query + required: false + schema: + type: integer + maximum: 50 + minimum: 1 + default: 10 + title: Limit responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_UserForAdminGet__' + $ref: '#/components/schemas/Envelope_list_UserGet__' /v0/admin/users:search: get: tags: @@ -8615,6 +8624,19 @@ components: title: Error type: object title: Envelope[UserForAdminGet] + Envelope_UserGet_: + properties: + data: + anyOf: + - $ref: '#/components/schemas/UserGet' + - type: 'null' + error: + anyOf: + - {} + - type: 'null' + title: Error + type: object + title: Envelope[UserGet] Envelope_WalletGetWithAvailableCredits_: properties: data: @@ -9264,6 +9286,22 @@ components: title: Error type: object title: Envelope[list[UserForAdminGet]] + Envelope_list_UserGet__: + properties: + data: + anyOf: + - items: + $ref: '#/components/schemas/UserGet' + type: array + - type: 'null' + title: Data + error: + anyOf: + - {} + - type: 'null' + title: Error + type: object + title: Envelope[list[UserGet]] Envelope_list_UserNotification__: properties: data: @@ -14478,6 +14516,45 @@ components: - registered - status title: UserForAdminGet + UserGet: + properties: + userId: + type: integer + exclusiveMinimum: true + title: Userid + minimum: 0 + groupId: + type: integer + exclusiveMinimum: true + title: Groupid + minimum: 0 + userName: + type: string + maxLength: 100 + minLength: 1 + title: Username + firstName: + anyOf: + - type: string + - type: 'null' + title: Firstname + lastName: + anyOf: + - type: string + - type: 'null' + title: Lastname + email: + anyOf: + - type: string + format: email + - type: 'null' + title: Email + type: object + required: + - userId + - groupId + - userName + title: UserGet UserNotification: properties: user_id: