Skip to content

Commit

Permalink
updates OAS
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Dec 16, 2024
1 parent 3d1d8a9 commit 7eaf541
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 9 deletions.
8 changes: 5 additions & 3 deletions api/specs/web-server/_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -150,18 +152,18 @@ 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()]):
...


@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()]):
...


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/Envelope_UserForAdminGet_'
$ref: '#/components/schemas/Envelope_UserGet_'
/v0/users:search:
post:
tags:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 7eaf541

Please sign in to comment.