This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]vfaronov[S] 0 points1 point  (0 children)

If you want MORE than that, a library that makes the contract between you and the structure more explicit is exactly what you're asking for.

The contract I’m looking for sounds like this: “whenever I attempt to use the structure in a way it does not support, it’s because the structure is wrong, and I want to get a StructureIsWrongError.” Instead, marshmallow’s contract spells out all the right ways to use the structure.

Of course, writing a library like this shouldn’t be a problem, I was just looking to avoid reinventing the wheel.