-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
120 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
paths: | ||
/announcements: | ||
get: | ||
tags: | ||
- announcements | ||
summary: List Announcements | ||
operationId: list_announcements | ||
responses: | ||
'200': | ||
description: Successful Response | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Envelope_list_simcore_service_webserver.announcements._models.Announcement__' | ||
components: | ||
schemas: | ||
Announcement: | ||
properties: | ||
id: | ||
type: string | ||
title: Id | ||
products: | ||
items: | ||
type: string | ||
enum: | ||
- osparc | ||
- s4l | ||
- s4llite | ||
- tis | ||
type: array | ||
title: Products | ||
start: | ||
type: string | ||
format: date-time | ||
title: Start | ||
end: | ||
type: string | ||
format: date-time | ||
title: End | ||
title: | ||
type: string | ||
title: Title | ||
description: | ||
type: string | ||
title: Description | ||
link: | ||
type: string | ||
title: Link | ||
widgets: | ||
items: | ||
type: string | ||
enum: | ||
- login | ||
- ribbon | ||
- user-menu | ||
type: array | ||
title: Widgets | ||
type: object | ||
required: | ||
- id | ||
- products | ||
- start | ||
- end | ||
- title | ||
- description | ||
- link | ||
- widgets | ||
title: Announcement | ||
Envelope_list_simcore_service_webserver.announcements._models.Announcement__: | ||
properties: | ||
data: | ||
items: | ||
$ref: '#/components/schemas/Announcement' | ||
type: array | ||
title: Data | ||
error: | ||
title: Error | ||
type: object | ||
title: Envelope[list[simcore_service_webserver.announcements._models.Announcement]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" Helper script to generate OAS automatically | ||
""" | ||
|
||
# pylint: disable=redefined-outer-name | ||
# pylint: disable=unused-argument | ||
# pylint: disable=unused-variable | ||
# pylint: disable=too-many-arguments | ||
|
||
|
||
from enum import Enum | ||
|
||
from fastapi import FastAPI | ||
from models_library.generics import Envelope | ||
from simcore_service_webserver.announcements._handlers import Announcement | ||
|
||
app = FastAPI(redoc_url=None) | ||
|
||
TAGS: list[str | Enum] = [ | ||
"announcements", | ||
] | ||
|
||
|
||
@app.get( | ||
"/announcements", | ||
response_model=Envelope[list[Announcement]], | ||
tags=TAGS, | ||
operation_id="list_announcements", | ||
) | ||
async def list_announcements(): | ||
... | ||
|
||
|
||
if __name__ == "__main__": | ||
from _common import CURRENT_DIR, create_openapi_specs | ||
|
||
create_openapi_specs(app, CURRENT_DIR.parent / "openapi-announcements.yaml") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Extra reqs, besides webserver's | ||
|
||
fastapi | ||
fastapi<0.100 | ||
jsonref |