diff --git a/README.md b/README.md
index 9c9aeed..68f3fb4 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
smartbetsAPI
-
+
> "Punter's choice"
diff --git a/smartbets_API/__init__.py b/smartbets_API/__init__.py
index d1708ba..38b2e24 100644
--- a/smartbets_API/__init__.py
+++ b/smartbets_API/__init__.py
@@ -1,4 +1,4 @@
-__version__ = "1.2.6"
+__version__ = "1.2.7"
__author__ = "Smartwa Caleb"
from .bet_at_rest_api_level import predictor as rest_api
from .predictor import predictor
diff --git a/smartbets_API/interface.py b/smartbets_API/interface.py
index 14263d8..03fccba 100644
--- a/smartbets_API/interface.py
+++ b/smartbets_API/interface.py
@@ -89,10 +89,7 @@ def parse_handler():
"name": "Smartwa",
"url": "https://github.com/Simatwa",
"email": "simatwacaleb@proton.me",
- },
- docs_url="/v1/docs",
- redoc_url="/v1/redoc",
- # openapi_prefix="/v1",
+ }
)
v1_router = APIRouter(prefix="/v1", tags=["v1"])
@@ -113,6 +110,17 @@ class Match(BaseModel):
away: str
net: bool = False
+ model_config = {
+ "json_schema_extra": {
+ "examples": [
+ {
+ "home": "Arsenal",
+ "away": "Manchester United",
+ "net": False
+ }
+ ]
+ }
+ }
class Prediction(BaseModel):
"""Match prediction
@@ -135,6 +143,22 @@ class Prediction(BaseModel):
result: str
pick: str
+ model_config = {
+ "json_schema_extra": {
+ "examples": [
+ {
+ "g": 10,
+ "gg": 70,
+ "ov15": 75,
+ "ov25": 40,
+ "ov35": 25,
+ "choice": 55.56,
+ "result": "1",
+ "pick": "ov15"
+ }
+ ]
+ }
+ }
class ServerStatus(BaseModel):
"""Checks server's running status
@@ -145,6 +169,14 @@ class ServerStatus(BaseModel):
is_alive: bool = True
as_at: datetime = datetime.utcnow()
+class TokenAuth(BaseModel):
+ """
+ - `access_token` : Token value.
+ - `token_type` : bearer
+ """
+ access_token:str
+ token_type:str
+
def verify_token(token: Annotated[str, Depends(v1_auth_scheme)]):
"""Ensures token passed match the one set"""
@@ -171,13 +203,11 @@ def server_status() -> ServerStatus:
@v1_router.post("/token")
-def fetch_token(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]):
- """Fetch api token"""
+def fetch_token(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]) -> TokenAuth:
+ """Fetch api token
+ """
if form_data.username == args.username and form_data.password == args.token:
- return {
- "access_token": args.token,
- "token_type": "bearer",
- }
+ return TokenAuth(**{"access_token": args.token,"token_type": "bearer",})
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,