Skip to content
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

Switch from colander to jsonschema? #872

Closed
leplatrem opened this issue Oct 20, 2016 · 2 comments
Closed

Switch from colander to jsonschema? #872

leplatrem opened this issue Oct 20, 2016 · 2 comments
Labels

Comments

@leplatrem
Copy link
Contributor

Now that Cornice 2.0 supports any kind of validation, we could switch from colander to jsonschema, since it's already a dependency.

Pros:

Cons:

  • jsonschema are verbose
  • Lib may not be as solid as colander?
  • Validation errors may not be as clear?
  • Would break API of kinto.core

Related #790

@Natim
Copy link
Member

Natim commented Oct 21, 2016

I am not against using JSONSchema for that but rather a bit reluctant.
How would it looks like in terms of code separation? Will we create JSON files with the JSONSchema for each kind? (bucket, collection, group, permission, record, history, webpush) and load the file from the Python code?

As you said the biggest impact would be the error messages that would be hard to configure.

I am not sure it worth it to be honest.

@leplatrem
Copy link
Contributor Author

How would it looks like in terms of code separation?

Instead of having Colander classes, we would have simple dicts in the source code (not JSON files)

I am not sure it worth it to be honest.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants