diff --git a/userdata_api/schemas/types/scope.py b/userdata_api/schemas/types/scope.py index e3216ff..ce33acf 100644 --- a/userdata_api/schemas/types/scope.py +++ b/userdata_api/schemas/types/scope.py @@ -1,7 +1,7 @@ import string from typing import Any -from pydantic._internal import _schema_generation_shared +from pydantic import GetCoreSchemaHandler, GetJsonSchemaHandler from pydantic.json_schema import JsonSchemaValue from pydantic_core import core_schema @@ -19,12 +19,13 @@ class Scope: def __get_pydantic_core_schema__( cls, source: type[Any], + handler: GetCoreSchemaHandler, ) -> core_schema.CoreSchema: return core_schema.general_after_validator_function(cls._validate, core_schema.str_schema()) @classmethod def __get_pydantic_json_schema__( - cls, core_schema: core_schema.CoreSchema, handler: _schema_generation_shared.GetJsonSchemaHandler + cls, core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler ) -> JsonSchemaValue: field_schema = handler(core_schema) field_schema.update(type='string', format='scope')