Feature Request: generate Mongo validation rules #1115
nahuel
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It will be nice to be able to generate Mongo validation rules from Beanie models. Currently is trivial to run
SomeRootModel.schema()
and get the JSON schema from Pydantic, but:$jsonSchema
mongo operator.$def
block and links those definitions using a$ref
link, this is non compatible with Mongo, as it doesn't support$ref
s, so every$ref
should be changed to an inline definition.contains
) with some differences that should be addressed to get a valid validation rules schema from the JSON schema generated by Pydantic:See:
Beta Was this translation helpful? Give feedback.
All reactions