Skip to content

Commit 5943e72

Browse files
update openapi spec
1 parent cd897d3 commit 5943e72

File tree

2 files changed

+35
-23
lines changed

2 files changed

+35
-23
lines changed

api/specs/web-server/_auth_api_keys.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
from typing import Annotated
22

3+
from _common import as_query
34
from fastapi import APIRouter, Depends, status
45
from models_library.api_schemas_webserver.auth import (
56
ApiKeyCreateRequest,
67
ApiKeyCreateResponse,
78
ApiKeyGet,
9+
ApiKeyListQueryParams,
810
)
911
from models_library.generics import Envelope
1012
from models_library.rest_error import EnvelopedError
@@ -39,7 +41,9 @@ async def create_api_key(_body: ApiKeyCreateRequest):
3941
response_model=Envelope[list[ApiKeyGet]],
4042
status_code=status.HTTP_200_OK,
4143
)
42-
async def list_api_keys():
44+
async def list_api_keys(
45+
_query: Annotated[as_query(ApiKeyListQueryParams), Depends()],
46+
):
4347
"""lists API keys by this user"""
4448

4549

services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -381,62 +381,70 @@ paths:
381381
schema: {}
382382
image/png: {}
383383
/v0/auth/api-keys:
384-
get:
384+
post:
385385
tags:
386386
- auth
387-
summary: List Api Keys
388-
description: lists API keys by this user
389-
operationId: list_api_keys
387+
summary: Create Api Key
388+
description: creates API keys to access public API
389+
operationId: create_api_key
390+
requestBody:
391+
required: true
392+
content:
393+
application/json:
394+
schema:
395+
$ref: '#/components/schemas/ApiKeyCreateRequest'
390396
responses:
391-
'200':
397+
'201':
392398
description: Successful Response
393399
content:
394400
application/json:
395401
schema:
396-
$ref: '#/components/schemas/Envelope_list_ApiKeyGet__'
402+
$ref: '#/components/schemas/Envelope_ApiKeyCreateResponse_'
397403
'409':
398-
description: Conflict
399404
content:
400405
application/json:
401406
schema:
402407
$ref: '#/components/schemas/EnvelopedError'
408+
description: Conflict
403409
'404':
404-
description: Not Found
405410
content:
406411
application/json:
407412
schema:
408413
$ref: '#/components/schemas/EnvelopedError'
409-
post:
414+
description: Not Found
415+
get:
410416
tags:
411417
- auth
412-
summary: Create Api Key
413-
description: creates API keys to access public API
414-
operationId: create_api_key
415-
requestBody:
416-
content:
417-
application/json:
418-
schema:
419-
$ref: '#/components/schemas/ApiKeyCreateRequest'
420-
required: true
418+
summary: List Api Keys
419+
description: lists API keys by this user
420+
operationId: list_api_keys
421+
parameters:
422+
- name: include_autogenerated
423+
in: query
424+
required: false
425+
schema:
426+
type: boolean
427+
default: false
428+
title: Include Autogenerated
421429
responses:
422-
'201':
430+
'200':
423431
description: Successful Response
424432
content:
425433
application/json:
426434
schema:
427-
$ref: '#/components/schemas/Envelope_ApiKeyCreateResponse_'
435+
$ref: '#/components/schemas/Envelope_list_ApiKeyGet__'
428436
'409':
429-
description: Conflict
430437
content:
431438
application/json:
432439
schema:
433440
$ref: '#/components/schemas/EnvelopedError'
441+
description: Conflict
434442
'404':
435-
description: Not Found
436443
content:
437444
application/json:
438445
schema:
439446
$ref: '#/components/schemas/EnvelopedError'
447+
description: Not Found
440448
/v0/auth/api-keys/{api_key_id}:
441449
get:
442450
tags:

0 commit comments

Comments
 (0)