Comments (1)
You can use validators with annotated types to achieve this type of syntax: https://docs.pydantic.dev/latest/concepts/validators/#annotated-validators.
Marking as resolved :).
from pydantic.
Related Issues (20)
- Python regex flags are not supported HOT 6
- Time serialization can silently drop timezone HOT 4
- Pydantic v2.7+ fails to validate MultiValueEnum fields HOT 2
- Create a model dynamically with create_model() specifying a subset of fields in V2 HOT 8
- Extra ignore does not seems to work on my case HOT 1
- Field deprecation with typing_extension.deprecated example in `doc>concepts/fields` does not work HOT 2
- validate_assignment = True & @model_validator(mode='after') crashes HOT 1
- No package metadata was found for email-validator HOT 3
- mypy plugin reports unsafe variance error on frozen models HOT 2
- mypy plugin reports an unsafe variance error with no line number when extending class where the error is suppressed HOT 3
- Model validator is ignored during inheritance HOT 3
- When using model_validator in mode=before in a child A of pydantic class, this affects also other children. HOT 1
- Discriminated Union: wrong type is chosen for serialization HOT 2
- use SkipValidation not working with orm @property Decorator HOT 6
- HttpUrl doesn't require TLD HOT 2
- Drop support for pytest 7.4 HOT 2
- Frequent occurrence of attributes without errors HOT 3
- __pydantic_extra__ value validators passed entire dict HOT 11
- Pydantic 1.X doesn't work with Python 3.12.4 HOT 5
- TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard' HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pydantic.