Encode unknown enum values as numbers in URLs, query parameters, and routing headers
Closed this issue · 2 comments
jskeet commented
ProtobufUtilities.FormatValueAsJsonPrimitive is used for URL segments, query parameters, and routing headers.
Current behavior is to return the original proto enum value name, or null if the value is unknown. We should at least encode unknown values as the numeric value (which is what JSON formatter does).
jskeet commented
I suspect we'll actually throw exceptions at the moment rather than making incorrect requests - at least in the REST adapter. (I suspect the routing header value would be omitted for a regular gRPC use case.)
jskeet commented
Note: this code is now merged, but not released.