From a7fe6c06cf34a110b0eb3ad51260843d0bea3fe7 Mon Sep 17 00:00:00 2001 From: Giancarlo Romeo Date: Mon, 18 Nov 2024 11:50:22 +0100 Subject: [PATCH] fix field --- api/specs/web-server/_common.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/specs/web-server/_common.py b/api/specs/web-server/_common.py index f3dcd66bc5c..25341fd2a31 100644 --- a/api/specs/web-server/_common.py +++ b/api/specs/web-server/_common.py @@ -8,6 +8,7 @@ from typing import Any, ClassVar, NamedTuple import yaml +from common_library.pydantic_fields_extension import get_type from fastapi import FastAPI from models_library.basic_types import LogLevel from pydantic import BaseModel, Field @@ -116,8 +117,8 @@ def assert_handler_signature_against_model( # query and path parameters implemented_params = [ - ParamSpec(field.name, field.type_, field.field_info) - for field in model_cls.__fields__.values() + ParamSpec(name, get_type(info), info) + for name, info in model_cls.model_fields.items() ] assert {p.name for p in implemented_params}.issubset( # nosec