Replies: 1 comment
-
Hi, i have something similar. We have jsonschemas which do something like this: ...
},
"lastName": {
"type": "string",
"description": "The person's last name."
},
"age": {
"description": "Age in years which must be equal to or greater than zero.",
"type": "integer",
"minimum": 0
}
},
"allOf": [
{
"if": {
"properties": {
"lastName": { "const": "Doe" }
}
},
"then": {
"required": ["age"]
}
}
]
} Do you have something like this in mind. christian |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First I want to start with a big thank you to the community for creating such a great package. It's been helping us a lot.
It would be nice to be able to add custom Pydantic validators to some of the classes that require non-trivial validation logic.
This would be helpful as the model is then consumed by FastAPI, which would run these validators during de-serialization.
While I understand this is probably not currently supported (unless I missed something), I was wondering if there was some way I could customize the codegen step such that these Pydantic validators can be added directly.
Beta Was this translation helpful? Give feedback.
All reactions