-
Notifications
You must be signed in to change notification settings - Fork 145
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
Add to_json function, that would eventually output json #133
Comments
See https://github.com/plamut/colander/tree/json_support_iss112 for an initial stab by @plamut |
Oops, no, sorry, that's wrong.. that branch deals with json schemas, not json data. |
Yep, that's the catch :) Do you have any suggestions how to implement json data output? I have On Tue, Aug 20, 2013 at 4:56 PM, Chris McDonough
|
See my comment attached to #80. In my own project I've added NativeInteger and NativeBoolean classes that do what you want. Whereas Integer converts a str to an int and back, NativeInteger simply converts everything to an int both ways. I'd like feedback on the idea before I create a patch for colander. Are you interested, @offlinehacker and @mcdonc? |
Sounds interesting, but what about just having to_json function that would On Thu, Aug 22, 2013 at 11:08 PM, Shane Hathaway
|
Keep in mind that Javascript (from where json came from, and with whom json is frequently used for communication) doesn't actually have proper integers, and you could silently lose information in the event of a roundtrip of a json structure through Javascript: http://cdivilly.wordpress.com/2012/04/11/json-javascript-large-64-bit-integers/ |
Just curious, has anyone made any progress on this? It's a feature I'd love to see. @hathawsh If you have a patch (even if it's hacky), I'd find it useful. |
We've discussed modifying the serialization format of colander to use json inherently in a major version update (colander 2). I'm not shooting down this ticket outright, but I'm fairly certain that the |
Thanks for the response, @mmerickel. Just to put it out there, adding |
The colander "pace of development" isn't exactly staggering, so I'd think that making your own custom types (like |
+1 for |
As we already know result from serializer resemble json, but not really(every element has eventually string type). I think a function is needed that would serialize a data and output json, because that's what you need in REST services.
@plamut is working on json schema in #112, but there's not even a proper function that would output json. I would do it, but i don't know what's the proper way, because serializer does not give me type information, so output from it is not very usefull.
As far as i understand a parallel implementation(to serializtion) would be needed, but wouldn't it be just simpler for serializer to output json and preserve type information this way, or are there any other issues i'm not aware of?
The text was updated successfully, but these errors were encountered: