Improved method detection
Some checks failed
Run Python tests (through Pytest) / Test (push) Failing after 23s
Verify Python project can be installed, loaded and have version checked / Test (push) Failing after 21s

This commit is contained in:
Jon Michael Aanes 2025-05-13 21:19:02 +02:00
parent ab0531cf05
commit e769f27957
2 changed files with 8 additions and 2 deletions

View File

@ -6,7 +6,10 @@ from fastapi.encoders import jsonable_encoder
from . import tools
app = FastAPI()
app = FastAPI(
title='Clients',
summary='Provides various clients.'
)
origins = [
"http://localhost.tiangolo.com",
@ -26,4 +29,4 @@ app.add_middleware(
for tool in tools.get_tools():
component, method = tool.__name__.split('.')
path = f'/{component}/{method}'
app.get(path, response_model=None)(tool)
app.get(path, response_model=None,tags=[component])(tool)

View File

@ -1,6 +1,7 @@
import dataclasses
import logging
from decimal import Decimal
import typing
import clients
import requests_cache
@ -109,6 +110,8 @@ def wrap_all_methods_on_client(obj):
method = getattr(obj, field_name)
if not callable(method):
continue
if not hasattr(method, '__name__'):
continue
if method.__doc__ is None:
continue
yield wrap_method(obj.__class__, method)