feat: API Fixes and Adjustments (#23)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Alexandre Teles (afterSt0rm)
2023-07-19 23:32:48 -03:00
committed by GitHub
parent 1273f9224b
commit b18097e030
24 changed files with 563 additions and 565 deletions

View File

@@ -1,4 +1,5 @@
from pydantic import BaseModel
from api.models.github import ContributorsFields
class ToolsResponseFields(BaseModel):
@@ -25,3 +26,24 @@ class ToolsResponseModel(BaseModel):
"""
tools: list[ToolsResponseFields]
class ContributorsResponseFields(BaseModel):
"""Implements the fields for the /contributors endpoint.
Args:
BaseModel (pydantic.BaseModel): BaseModel from pydantic
"""
name: str
contributors: list[ContributorsFields]
class ContributorsResponseModel(BaseModel):
"""Implements the JSON response model for the /contributors endpoint.
Args:
BaseModel (pydantic.BaseModel): BaseModel from pydantic
"""
repositories: list[ContributorsResponseFields]

View File

@@ -1,13 +1,18 @@
from pydantic import BaseModel
class DonationFields(BaseModel):
"""
A Pydantic BaseModel that represents all the donation links and wallets.
"""
wallets: dict[str, str]
links: dict[str, str]
class DonationsResponseModel(BaseModel):
"""
A Pydantic BaseModel that represents a dictionary of donation links.
"""
donations: dict[str, str]
"""
A dictionary where the keys are the names of the donation destinations, and
the values are the links to services or wallet addresses.
"""
donations: DonationFields

View File

@@ -117,6 +117,7 @@ class TeamMemberFields(BaseModel):
login: str
avatar_url: str
html_url: str
bio: Optional[str]
class TeamMembersModel(BaseModel):