-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check() and validate #7
Comments
I would love if this could serialize to json schema to allow driving libraries like json-editor |
You might want to check some considerations for Schemas I've writted up in https://ict.swisscom.ch/2017/12/python-schema/. There are many solutions, none fits all purposes and most of them leave lot to be improved. |
One thing I've been frustrated with validation libraries is the ability to set custom error messages (mainly for backwards compatibility reasons). Some provide this kind of functionality, but once the schema becomes more complex (for example with nested or with recursive data) then they don't have the desired flexibility. If this can be provided by |
@mcgfeller Thanks for the link to the overview document! The related update from us is that we're designing some new interface definitions and still discussing whether to push these down into glom (possibly using the new extension API merged in #9 which is pending launch) or to simply build something that complements glom. @dwt Per the comment above, Kurt and I are still floating how to expose the limited dialect of glomspecs that also fit into json schema. Definitely an area of interest :) @jcollado I'm definitely open to this idea, and I created #42 to discuss it further :) |
Beyond the replies above, I think #25 being merged closes out this first generation issue :) Thanks all! |
While this wasn't on my mind when I first started out, it's been pointed out to me that
glom
may also benefit from a validation story.Some preliminary design work suggests the following would work well:
Check()
specifier typetype=...
,value=...
, and maybe other kwargs.action
kwarg to determine what to do if theCheck
fails the condition ('omit', 'raise', other?)Inspect
, where it can wrap a spec or appear on it's own (probably after the spec it's supposed to check)This is great for an
assert
-like functionality here and there, but for heavily Checked specs, we may want to have a convenience construct of some sort.The text was updated successfully, but these errors were encountered: