-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(extras): Fix generation of JSON Schema for Pydantic
Rut
type
Attempting to generate a JSON Schema using `pydantic.BaseModel.model_json_schema()` or `pydantic.TypeAdapter.json_schema()` fails with the following error message: > pydantic.errors.PydanticInvalidForJsonSchema: > Cannot generate a JsonSchema for core_schema.PlainValidatorFunctionSchema ({ > 'type': 'no-info', > 'function': <function _RutPydanticAnnotation.__get_pydantic_core_schema__.<locals>.validate_from_str at 0x…> > }) This commit fixes the above error by implementing `__get_pydantic_json_schema__` to override the generated JSON Schema.
- Loading branch information
1 parent
9fc64b3
commit dee3fa7
Showing
2 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters