serializr icon indicating copy to clipboard operation
serializr copied to clipboard

Add support for embedded types

Open danfma opened this issue 4 years ago • 2 comments

These changes will allow support for embedded types or maybe more powerful custom serializers. It allows the user to change the outputted object during the serialization/deserialization.

  • A new custom type was created too (embedded), which embed the object data into the parent resulting JSON (and vice-versa).

danfma avatar Aug 26 '20 21:08 danfma

@NaridaL @mweststrate Should I update the README manually or did I miss any step? Locally, it looks to be working (build and tests). :)

danfma avatar Aug 26 '20 21:08 danfma

This is an interesting idea. I think inline might suggest its purpose more readily? As a decorator it would then read @serialize(inline(ClassName)).

I do see a lot of potential for property collisions or otherwise acting on a JSON element more than once, which gives me pause.

Interestingly, in my own work, I could use the opposite: I have to deal with wiretypes full of totally unnecessary object nesting.

pyrogenic avatar Jan 02 '21 01:01 pyrogenic