Skip to content

encoder: allow encoders for top-level proto? #25

@mping-exo

Description

@mping-exo

Related to #22.

I think it would be useful to allow encoders for top-level protobuf objects:

(defmapper mapper [ObjectReference]
           :encoders {ObjectReference
                      {:from-proto (fn [^ObjectReference proto-obj] ...)
                       :to-proto   (fn [clj-map] ...)}})

This would be useful for cases where we want to use a clojure type that has no native representation in protobuf, such as keywords or UUIDs.
Besides, it would make the library more orthogonal, since it already supports mappings for nested types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions