Skip to content

Commit

Permalink
Merge pull request #447 from BoostryJP/feature/#443
Browse files Browse the repository at this point in the history
feat: Add openapi tag descriptions
  • Loading branch information
YoshihitoAso authored Dec 28, 2022
2 parents bbb4727 + d403bb3 commit f14a9fe
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 11 deletions.
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

0 comments on commit f14a9fe

Please sign in to comment.