-
Notifications
You must be signed in to change notification settings - Fork 14
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
12 additions
and
8 deletions.
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# from pydantic import BaseModel | ||
from pydantic import BaseModel | ||
|
||
# class Example(BaseModel): | ||
# id: str | ||
# wallet: str | ||
|
||
class Example(BaseModel): | ||
id: str | ||
wallet: str |
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 |
---|---|---|
|
@@ -25,6 +25,7 @@ module = [ | |
"lnbits.*", | ||
"loguru.*", | ||
"fastapi.*", | ||
"pydantic.*", | ||
] | ||
ignore_missing_imports = "True" | ||
|
||
|
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
from fastapi import APIRouter | ||
|
||
from .models import Example | ||
|
||
# views_api.py is for you API endpoints that could be hit by another service | ||
|
||
example_ext_api = APIRouter() | ||
|
||
|
||
@example_ext_api.get("/api/v1/test/{test_data}") | ||
async def api_example(test_data): | ||
async def api_example(test_data: str) -> Example: | ||
# Do some python things and return the data | ||
return test_data | ||
return Example(id="1", wallet=test_data) |