AppsFlyer / pronto

Clojure support for protocol buffers
110 stars 8 forks source link

:key-name-fn doesn't seem to apply to embedded definitions #24

Closed mping-exo closed 8 months ago

mping-exo commented 8 months ago

Consider this:

(p/defmapper mapper [XXX$ListVolumesResponse XXX$VolumeMetadata] :key-name-fn u/->kebab-case)

(let [x (-> (XXX$ListVolumesResponse/newBuilder)
            (.setVolumeId "XXXXXX")
            (.setVolumeMetadata (-> (XXX$VolumeMetadata/newBuilder)
                                    (.setCurrentSnapshotId 1)))
            (.build))]
  (p/proto->proto-map mapper x))
=> {:volume-id "XXXXXX", :volume-metadata {:currentsnapshotid 1}}

Shouldn't the embedded message volume-metadata key be called current-snapshot-id instead?

mping-exo commented 8 months ago

Nevermind, the protobuf field is defined as currentSnapshotId. Closing