Skip to content
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

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

Open
mping-exo opened this issue Apr 4, 2024 · 0 comments
Open

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

mping-exo opened this issue Apr 4, 2024 · 0 comments

Comments

@mping-exo
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant