Skip to content

Rework automatic serialization #101

@arnetheduck

Description

@arnetheduck

#86 introduced some support for disabling automatic serialization - however:

  • using a macro cache has undesireable complexity of usage - for example, if a.nim calls setAutoSerialize(true) and b.nim doesn't, serialization in b.nim will work or not depending on import order and / or whether a was imported at all - for example, compiling a and b together will work, but compiling b on its own will not (this can be seen in the json-rpc test suite where test_router_rpc compiles when part of all_tests but not on its own because the automatic serialization is configured in some other test
  • if two modules set opposite values, the semantics are unclear - having setAutoSerialize take a boolean parameter is difficult to understand and work with
  • the API is unclear - why is setAutoSerialize different from useDefaultSerializationIn and why can't the latter be used for auto-serialization of primitives? the inconsistency makes the API hard to understand when there are two similar ways of doing the same thing (enabling "default" serialization for a type)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions