-
-
Notifications
You must be signed in to change notification settings - Fork 8
Description
When passing User from scim2-models as a parameter to FastAPI like this
@app.post("/")
async def create_user(user: User):
return User(
user_name="test user"
)
The following error occurs
pydantic.errors.PydanticInvalidForJsonSchema: Cannot generate a JsonSchema for core_schema.PlainValidatorFunctionSchema ({'type': 'no-info', 'function': <function Reference.__get_pydantic_core_schema__.<locals>.validate at 0x7fdf8892a6c0>})
This also occurs if you try to pass types Group, PatchOp, list[PatchOperation] and EnterpriseUser. This is most likely because Pydantic can't create a json schema of the Reference type (as the error suggests). There already exists issue in the Pydantic library with a possible fix.
Metadata
Metadata
Assignees
Labels
No labels