Hi I am getting a json response by hitting a rest api. In the response, a
field named "state" is an enum guaranteed by the api to take 2 values
"active", "deleting".
Following is the relevant part of the schema:
..."state" : {
"enum" : {
"active",
"deleting"
}
"type" : "string"}...
and here is the paste of complete schema: https://pastebin.com/htH2Ln7f
The response looks something like the
{
...
"state" : "active",
...}
and here is the paste of complete response from
server: https://pastebin.com/WdnreFLr
I can just have a message with field state and type string. But is there a
way to have state field in proto message as an enum?
In other words is the following possible:
message Response {
enum State {
ACTIVE = 0;
DELETING = 1;
}
optional State state = 1;
// other fields
}
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.