You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are now wondering what would it take to transform this rough work into an acceptable pull request for you as we would rather have python-rapidjson support the schema validation than use our own isolated approach.
I spent some time on this, and I have a couple of questions:
in your implementation, I see that here you create a new SchemaDocument, that does not seem being freed (there's no tp_dealloc on the Python type): being a newbie in C++, is that correct?
how would this integrate with the PyRJ extensions such as datetime handling for example? Should the validation happen at the lowest level (that is, on plain JSON stream), or should the new Schema object validate() method accept most of the arguments current rapidjson.loads() accepts?
It's quite possible that the python type is missing a call to deallocate the SchemaDocument. In our use case it is not needed since the SchemaType is only loaded once and is not freed. I made an issue.
Not sure. I suppose that ideally it would be flexible but I don't know how rapidjson extensions work. It seems like you might be constrained by the interface rapidjson::Document d; accept = d.Accept(validator);.
Activity
lelit commentedon Apr 22, 2017
No: can you expand a little on what would be needed?
sbellem commentedon May 22, 2017
This is something we are interested in at @bigchaindb as we were able to speed up our validation by a factor of 3, using rapidjson with this rough first cut (by @libscott): https://github.com/bigchaindb/python-rapidjson-schema (the wrapping code is under https://github.com/bigchaindb/python-rapidjson-schema/blob/master/schema.cpp).
We are now wondering what would it take to transform this rough work into an acceptable pull request for you as we would rather have python-rapidjson support the schema validation than use our own isolated approach.
lelit commentedon May 22, 2017
Thank you, I will try to have a look and better understand it in the following days.
sbellem commentedon May 23, 2017
Thanks a lot!
/cc @libscott @r-marques
lelit commentedon Jul 3, 2017
I spent some time on this, and I have a couple of questions:
SchemaDocument, that does not seem being freed (there's notp_deallocon the Python type): being a newbie in C++, is that correct?datetimehandling for example? Should the validation happen at the lowest level (that is, on plain JSON stream), or should the newSchemaobjectvalidate()method accept most of the arguments currentrapidjson.loads()accepts?ssadler commentedon Jul 4, 2017
SchemaTypeis only loaded once and is not freed. I made an issue.rapidjson::Document d; accept = d.Accept(validator);.First cut at a Validator class
lelit commentedon Aug 17, 2017
@libscott, could you give a look and tell me how it sounds?
lelit commentedon Aug 24, 2017
Implemented in version 0.2.