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 from . import tools
app = FastAPI() app = FastAPI(
title='Clients',
summary='Provides various clients.'
)
origins = [ origins = [
"http://localhost.tiangolo.com", "http://localhost.tiangolo.com",
@ -26,4 +29,4 @@ app.add_middleware(
for tool in tools.get_tools(): for tool in tools.get_tools():
component, method = tool.__name__.split('.') component, method = tool.__name__.split('.')
path = f'/{component}/{method}' 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 dataclasses
import logging import logging
from decimal import Decimal from decimal import Decimal
import typing
import clients import clients
import requests_cache import requests_cache
@ -109,6 +110,8 @@ def wrap_all_methods_on_client(obj):
method = getattr(obj, field_name) method = getattr(obj, field_name)
if not callable(method): if not callable(method):
continue continue
if not hasattr(method, '__name__'):
continue
if method.__doc__ is None: if method.__doc__ is None:
continue continue
yield wrap_method(obj.__class__, method) yield wrap_method(obj.__class__, method)