pronto
pronto copied to clipboard
optional enums are always set with default value
Consider the following proto definition:
enum JobStatus {
JOBSTATUS_UNKNOWN = 0;
JOBSTATUS_NEW = 1;
}
message Request {
optional JobStatus status = 1;
optional string str = 2;
}
And the following mapping:
(p/defmapper xxx [Proto$Request])
(p/proto->proto-map xxx (-> (Proto$Request/newBuilder)
(.build)))
Since the field is optional, one would expect the resulting map to have the optional-but-not-present fields to be nil; however that doesn't happen:
{:status :JOBSTATUS_UNKNOWN, :str ""}