GithubHelp home page GithubHelp logo

Comments (3)

sloria avatar sloria commented on August 19, 2024

Email and URL fields have built-in "user validators" (stored in each field's validators attribute. User validators are only applied during deserialization, i.e. when calling Schema#load. Schema#dump only validates against field types (e.g. a valid integer is passed to fields.Int).

See #45 (comment) and #47 (comment) for related discussion.

That said, one could argue that the email format validation defines fields.Email's "type" and that it should be validated on serialization. Perhaps this would make fields.Email and fields.URL more consistent with the behavior of the other fields.

from marshmallow.

h0st1le avatar h0st1le commented on August 19, 2024

Thanks for the clarification, the related discussions also helped to better understand the reasoning behind this. That being said I do still like the idea of the fields.Email and fields.URL "type" being used for validation on serialization. As pointed out it would make their behavior more consistent with that of other fields. At the very least maybe an addition to the documentation that points out the current behavior?

from marshmallow.

sloria avatar sloria commented on August 19, 2024

I have decided to restore validation upon serialization for Email and URL fields. Thank you for raising the issue!

from marshmallow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.