mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 14:04:18 +02:00
refactor: standardize logging usage across OpenAPI utilities (#1322)
Co-authored-by: chiliu <chiliu@paypal.com>
This commit is contained in:
parent
cae431c001
commit
f9bb8e7005
4 changed files with 11 additions and 8 deletions
|
|
@ -6,10 +6,11 @@ to JSON Schema, inspired by py-openapi-schema-to-json-schema but optimized
|
|||
for our specific use case.
|
||||
"""
|
||||
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
from fastmcp.utilities.logging import get_logger
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
# OpenAPI-specific fields that should be removed from JSON Schema
|
||||
OPENAPI_SPECIFIC_FIELDS = {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
"""OpenAPI parsing logic for converting OpenAPI specs to HTTPRoute objects."""
|
||||
|
||||
import logging
|
||||
from typing import Any, Generic, TypeVar
|
||||
|
||||
from openapi_pydantic import (
|
||||
|
|
@ -25,6 +24,8 @@ from openapi_pydantic.v3.v3_0 import Response as Response_30
|
|||
from openapi_pydantic.v3.v3_0 import Schema as Schema_30
|
||||
from pydantic import BaseModel, ValidationError
|
||||
|
||||
from fastmcp.utilities.logging import get_logger
|
||||
|
||||
from .models import (
|
||||
HTTPRoute,
|
||||
JsonSchema,
|
||||
|
|
@ -35,7 +36,7 @@ from .models import (
|
|||
)
|
||||
from .schemas import _combine_schemas_and_map_params, _replace_ref_with_defs
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = get_logger(__name__)
|
||||
|
||||
# Type variables for generic parser
|
||||
TOpenAPI = TypeVar("TOpenAPI", OpenAPI, OpenAPI_30)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
"""Schema manipulation utilities for OpenAPI operations."""
|
||||
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
from fastmcp.utilities.logging import get_logger
|
||||
|
||||
from .models import HTTPRoute, JsonSchema, ResponseInfo
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = get_logger(__name__)
|
||||
|
||||
|
||||
def clean_schema_for_display(schema: JsonSchema | None) -> JsonSchema | None:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import json
|
||||
import logging
|
||||
from typing import Any, Generic, Literal, TypeVar, cast
|
||||
|
||||
from openapi_pydantic import (
|
||||
|
|
@ -24,9 +23,10 @@ from openapi_pydantic.v3.v3_0 import Response as Response_30
|
|||
from openapi_pydantic.v3.v3_0 import Schema as Schema_30
|
||||
from pydantic import BaseModel, Field, ValidationError
|
||||
|
||||
from fastmcp.utilities.logging import get_logger
|
||||
from fastmcp.utilities.types import FastMCPBaseModel
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = get_logger(__name__)
|
||||
|
||||
# --- Intermediate Representation (IR) Definition ---
|
||||
# (IR models remain the same)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue