Open gdlmx opened 2 months ago
Possible cause of this error:
See this discussion of a similar error with Pydantic v2.4
A correct implementation already exists on the Link
class.
Thanks for reporting the issue, and taking the time to investigate the cause. Would you like to send a PR to fix this issue, @gdlmx?
@adeelsohailahmed @gdlmx Any updated about this fix yet?
Thanks for reporting the issue, and taking the time to investigate the cause. Would you like to send a PR to fix this issue, @gdlmx?
Yes, I can prepare a PR to fix it. Could you provide me some idea about the proper json schema for BackLink?
Given this line
There is no guarantee of any field in a BackLink object, is there?
There is no guarantee of any field in a BackLink object, is there?
I'm not sure if I fully understand your question here. Could you elaborate more?
@gdlmx is there any update about the PR? :-)
Describe the bug Generating Json Schema from a document with a
BackLink
field will fail with the error:PydanticInvalidForJsonSchema
.To Reproduce
The last line will raise error:
Expected behavior The last line (model_json_schema) should return
Additional context Python version: 3.11 Beanie version: 1.26.0 Pydantic version: 2.8.2