Skip to content

Commit 4bee179

Browse files
committed
fix
1 parent fca8d6c commit 4bee179

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

api/specs/web-server/_common.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,14 @@
66
import sys
77
from collections.abc import Callable
88
from pathlib import Path
9-
from typing import (
10-
Annotated,
11-
Any,
12-
ClassVar,
13-
NamedTuple,
14-
Optional,
15-
Union,
16-
get_args,
17-
get_origin,
18-
)
9+
from typing import Annotated, Any, NamedTuple, Optional, Union, get_args, get_origin
1910

2011
import yaml
2112
from common_library.json_serialization import json_dumps
2213
from common_library.pydantic_fields_extension import get_type
2314
from fastapi import FastAPI, Query
2415
from models_library.basic_types import LogLevel
25-
from pydantic import BaseModel, Field, create_model
16+
from pydantic import BaseModel, ConfigDict, Field, create_model
2617
from pydantic.fields import FieldInfo
2718
from servicelib.fastapi.openapi import override_fastapi_openapi_method
2819

@@ -118,14 +109,15 @@ class Log(BaseModel):
118109
None, description="name of the logger receiving this message"
119110
)
120111

121-
class Config:
122-
schema_extra: ClassVar[dict[str, Any]] = {
112+
model_config = ConfigDict(
113+
json_schema_extra={
123114
"example": {
124115
"message": "Hi there, Mr user",
125116
"level": "INFO",
126117
"logger": "user-logger",
127118
}
128119
}
120+
)
129121

130122

131123
class ErrorItem(BaseModel):

0 commit comments

Comments
 (0)