Use ce_name attribute for mapping UAttributes names to CloudEvent names#89
Use ce_name attribute for mapping UAttributes names to CloudEvent names#89stevenhartley merged 3 commits intomainfrom
Conversation
| v.getOptions().getExtension(UprotocolOptions.ceName).equals(p)) | ||
| .map(v -> UPriority.forNumber(v.getNumber())) | ||
| .findFirst() | ||
| .orElse(UPriority.UNRECOGNIZED) |
There was a problem hiding this comment.
so if it can't be found you use UNRECOGNIZED and then ifPresent, so we get UNRECOGNIZED if missing, would it not be better to not have the orElse and then the ifPresent will not be called and the builder will not set any priority.
Having the UNRECOGNIZED feels like it could lead to all kinds of settings that are not needed in this case
There was a problem hiding this comment.
@tamarafischer you bring up an important point actually because priority is mandatory and If I do not set, protobuf will assign it to UNRECOGNIZED when we build UAttributes object so it is better to set it to UPRIORITY_UNSPECIFIED and then add this check in the validator.
There was a problem hiding this comment.
left a little comment but apart from that it looks sound
No description provided.