Comments (8)
@samuelcolvin Are the clean_ methods implemented in any way? I don't see "clean" in the source anywhere.
Here's the use case: I want to have an img_url or an img_src, but not both. If both, or neither, are supplied, I want to raise an exception. Will that fit what you have in mind for the clean methods?
from pydantic.
Currently implemented via validate_*
but not documented properly as I mean to change it completely.
from pydantic.
Is the usage I described a valid use case for what you intend to do?
from pydantic.
Actually if you're going to change it then I'll avoid bugging you about it. No sense making you write stuff down, I can wait.
from pydantic.
That's exactly the kind of use case.
from pydantic.
This should be fixed by version v0.6.
@pauleveritt documentation should now be available on validators, see here.
from pydantic.
@samuelcolvin Thanks for working on this, and perfect timing, I'm in an overhaul. FWIW, I'm working on a system to put structured YAML data in Sphinx docs, validated by pydantic.
from pydantic.
@samuelcolvin As an FYI, I'm using pydantic in an extensible system atop Sphinx. You register classes with models and can then embed schema-validated YAML in documents: https://github.com/pauleveritt/kaybee/blob/master/docs/features.rst#yaml-models
from pydantic.
Related Issues (20)
- Ai
- Allow `model_validate_json` to return valid JSON string upon raising error HOT 2
- case_sensitive doesn't work in optional nested Settings models
- mypy "Explicit "Any" is not allowed" error when extending `BaseModel` HOT 1
- TypeError: typing.ClassVar[int] is not valid as type argument HOT 3
- Enum construction from float worked in v2.6.4 but fails in v2.7.1
- cannot import name 'Optional' from 'pydantic' HOT 1
- Fields with BaseModel type that contain an instance of a model that inherits from BaseModel do not get serialized correctly HOT 2
- Pydantic and Pydantic Settings don't seem to provide library stubs for MyPy HOT 2
- StringConstraints: Bug HOT 2
- misleading error message "Input should be a valid dictionary or instance" when using both pydantic `dataclass` and `BaseModel`
- Class properties have a potential for namespace collision HOT 2
- Default values not validated HOT 11
- Can't pickle generics in certain cases
- typing.Self not supported in generic fields
- Serializing computed fields returning enums HOT 2
- Exception parsing negative integer strings
- Disallow Pydantic models when using `with_config`
- No key validation for typed `__pydantic_extra__`
- Schema for `Literal` differs between version 2.6 and 2.7 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.