Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add openapi tag descriptions #447

Merged
merged 1 commit into from
Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 49 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,57 @@
from app.exceptions import *
from app.log import output_access_log


tags_metadata = [
{
"name": "default",
"description": ""
},
{
"name": "common",
"description": "Common functions"
},
{
"name": "account",
"description": "Issuer account management"
},
{
"name": "notification",
"description": "Notifications for accounts"
},
{
"name": "token_common",
"description": "Common functions for tokens"
},
{
"name": "bond",
"description": "Bond token management"
},
{
"name": "share",
"description": "Share token management"
},
{
"name": "utility",
"description": "Utility functions"
},
{
"name": "messaging",
"description": "Messaging functions with external systems"
},
{
"name": "blockchain_explorer",
"description": "Blockchain explorer"
}
]

app = FastAPI(
title="ibet Prime",
version="23.3.0"
description="Security token management system for ibet network",
version="23.3.0",
contact={"email": "dev@boostry.co.jp"},
license_info={"name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html"},
openapi_tags=tags_metadata
)


Expand Down
5 changes: 4 additions & 1 deletion app/routers/e2e_messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@
ContractRevertError
)

router = APIRouter(prefix="/e2e_messaging", tags=["e2e_messaging"])
router = APIRouter(
prefix="/e2e_messaging",
tags=["messaging"]
)

local_tz = pytz.timezone(TZ)
utc_tz = pytz.timezone("UTC")
Expand Down
13 changes: 8 additions & 5 deletions app/routers/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,18 @@
)
from app.utils.docs_utils import get_routers_responses

router = APIRouter(tags=["file"])
router = APIRouter(
prefix="/files",
tags=["utility"]
)

local_tz = pytz.timezone(TZ)
utc_tz = pytz.timezone("UTC")


# GET: /files
@router.get(
"/files",
"",
response_model=ListAllFilesResponse,
responses=get_routers_responses(422)
)
Expand Down Expand Up @@ -137,7 +140,7 @@ def list_all_upload_files(

# POST: /files
@router.post(
"/files",
"",
response_model=FileResponse,
responses=get_routers_responses(422)
)
Expand Down Expand Up @@ -182,7 +185,7 @@ def upload_file(

# GET: /files/{file_id}
@router.get(
"/files/{file_id}",
"/{file_id}",
response_model=DownloadFileResponse,
responses=get_routers_responses(404)
)
Expand Down Expand Up @@ -227,7 +230,7 @@ def download_file(

# DELETE: /files/{file_id}
@router.delete(
"/files/{file_id}",
"/{file_id}",
response_model=None,
responses=get_routers_responses(422, 404)
)
Expand Down
2 changes: 1 addition & 1 deletion app/routers/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

LOG = log.get_logger()

router = APIRouter(tags=["index"])
router = APIRouter(tags=["common"])


# GET: /e2ee
Expand Down
2 changes: 1 addition & 1 deletion app/routers/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

router = APIRouter(
prefix="/ledger",
tags=["ledger"],
tags=["token_common"],
)

local_tz = pytz.timezone(TZ)
Expand Down
2 changes: 1 addition & 1 deletion app/routers/position.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
)
from app.exceptions import InvalidParameterError

router = APIRouter(tags=["position"])
router = APIRouter(tags=["token_common"])


# GET: /positions/{account_address}
Expand Down
2 changes: 1 addition & 1 deletion app/routers/token_holders.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

router = APIRouter(
prefix="/token",
tags=["token"],
tags=["token_common"],
)


Expand Down