Skip to content

Commit 197a915

Browse files
fix: openapi-spec
1 parent aefe339 commit 197a915

File tree

3 files changed

+139
-1
lines changed

3 files changed

+139
-1
lines changed

api/specs/web-server/_functions.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@
1010
from _common import as_query
1111
from fastapi import APIRouter, Depends, status
1212
from models_library.api_schemas_webserver.functions import (
13+
FunctionGroupGet,
14+
FunctionGroupUpdate,
1315
FunctionToRegister,
1416
RegisteredFunctionGet,
1517
RegisteredFunctionUpdate,
1618
)
1719
from models_library.generics import Envelope
1820
from simcore_service_webserver._meta import API_VTAG
21+
from simcore_service_webserver.functions._controller._functions_rest import (
22+
FunctionGroupPathParams,
23+
)
1924
from simcore_service_webserver.functions._controller._functions_rest_schemas import (
2025
FunctionGetQueryParams,
2126
FunctionPathParams,
@@ -75,3 +80,22 @@ async def update_function(
7580
async def delete_function(
7681
_path: Annotated[FunctionPathParams, Depends()],
7782
): ...
83+
84+
85+
@router.put(
86+
"/functions/{function_id}/groups/{group_id}",
87+
response_model=Envelope[FunctionGroupGet],
88+
)
89+
async def update_function_group(
90+
_path: Annotated[FunctionGroupPathParams, Depends()],
91+
_body: FunctionGroupUpdate,
92+
): ...
93+
94+
95+
@router.delete(
96+
"/functions/{function_id}/groups/{group_id}",
97+
status_code=status.HTTP_204_NO_CONTENT,
98+
)
99+
async def delete_function_group(
100+
_path: Annotated[FunctionGroupPathParams, Depends()],
101+
): ...

packages/models-library/src/models_library/api_schemas_webserver/functions.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,13 @@ class ProjectFunctionToRegister(ProjectFunction, InputSchema): ...
151151
class RegisteredFunctionUpdate(FunctionUpdate, InputSchema): ...
152152

153153

154-
class FunctionGroupUpdate(InputSchema):
154+
class FunctionGroupGet(OutputSchema):
155155
read: bool
156156
write: bool
157157
execute: bool
158+
159+
160+
class FunctionGroupUpdate(InputSchema):
161+
read: bool | None = None
162+
write: bool | None = None
163+
execute: bool | None = None

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

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3478,6 +3478,65 @@ paths:
34783478
responses:
34793479
'204':
34803480
description: Successful Response
3481+
/v0/functions/{function_id}/groups/{group_id}:
3482+
put:
3483+
tags:
3484+
- functions
3485+
summary: Update Function Group
3486+
operationId: update_function_group
3487+
parameters:
3488+
- name: function_id
3489+
in: path
3490+
required: true
3491+
schema:
3492+
type: string
3493+
format: uuid
3494+
title: Function Id
3495+
- name: group_id
3496+
in: path
3497+
required: true
3498+
schema:
3499+
type: integer
3500+
exclusiveMinimum: true
3501+
title: Group Id
3502+
minimum: 0
3503+
requestBody:
3504+
required: true
3505+
content:
3506+
application/json:
3507+
schema:
3508+
$ref: '#/components/schemas/FunctionGroupUpdate'
3509+
responses:
3510+
'200':
3511+
description: Successful Response
3512+
content:
3513+
application/json:
3514+
schema:
3515+
$ref: '#/components/schemas/Envelope_FunctionGroupGet_'
3516+
delete:
3517+
tags:
3518+
- functions
3519+
summary: Delete Function Group
3520+
operationId: delete_function_group
3521+
parameters:
3522+
- name: function_id
3523+
in: path
3524+
required: true
3525+
schema:
3526+
type: string
3527+
format: uuid
3528+
title: Function Id
3529+
- name: group_id
3530+
in: path
3531+
required: true
3532+
schema:
3533+
type: integer
3534+
exclusiveMinimum: true
3535+
title: Group Id
3536+
minimum: 0
3537+
responses:
3538+
'204':
3539+
description: Successful Response
34813540
/v0/tasks:
34823541
get:
34833542
tags:
@@ -10494,6 +10553,19 @@ components:
1049410553
title: Error
1049510554
type: object
1049610555
title: Envelope[FolderGet]
10556+
Envelope_FunctionGroupGet_:
10557+
properties:
10558+
data:
10559+
anyOf:
10560+
- $ref: '#/components/schemas/FunctionGroupGet'
10561+
- type: 'null'
10562+
error:
10563+
anyOf:
10564+
- {}
10565+
- type: 'null'
10566+
title: Error
10567+
type: object
10568+
title: Envelope[FunctionGroupGet]
1049710569
Envelope_GetProjectInactivityResponse_:
1049810570
properties:
1049910571
data:
@@ -12341,6 +12413,42 @@ components:
1234112413
additionalProperties: false
1234212414
type: object
1234312415
title: FunctionAccessRights
12416+
FunctionGroupGet:
12417+
properties:
12418+
read:
12419+
type: boolean
12420+
title: Read
12421+
write:
12422+
type: boolean
12423+
title: Write
12424+
execute:
12425+
type: boolean
12426+
title: Execute
12427+
type: object
12428+
required:
12429+
- read
12430+
- write
12431+
- execute
12432+
title: FunctionGroupGet
12433+
FunctionGroupUpdate:
12434+
properties:
12435+
read:
12436+
anyOf:
12437+
- type: boolean
12438+
- type: 'null'
12439+
title: Read
12440+
write:
12441+
anyOf:
12442+
- type: boolean
12443+
- type: 'null'
12444+
title: Write
12445+
execute:
12446+
anyOf:
12447+
- type: boolean
12448+
- type: 'null'
12449+
title: Execute
12450+
type: object
12451+
title: FunctionGroupUpdate
1234412452
GetProjectInactivityResponse:
1234512453
properties:
1234612454
is_inactive:

0 commit comments

Comments
 (0)