CAN AUTOBAHN USE A CUSTOM JSON ENCODER?

Madam Walker

Total Post:22

Points:154
Posted by  Madam Walker
JSON 
 1895  View(s)
Ratings:
Rate this:
Hi Developers,

When doing RPC with autobahn, autobahn supports procedures returning python objects as long as they are json serializable. Some objects I'd like to return are not by default json serializable. I can easily write a custom encoder, but how would autobahn know it needs to use it?

Thanks in advance for any recommendations or solutions.
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: Can Autobahn use a custom json encoder?

    You can override _serialize and _unserialize on your factories. See here. Please note that this API is (currently) not promised to be stable.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!