Hi,

I am using grpc-gateway to generate Swagger spec and it is generally
working very well. However, I am having trouble with marking some
fields as "read only" so that they don't show up in the request body
schema in Swagger UI.

Here is how I am configuring a field as "read only":

"string id = 2 [(grpc.gateway.protoc_gen_swagger.options.openapiv2_field)
= {read_only: true}];"

This seems to work for scalar types but not for structs. For example,
the following:

"Status status = 3
[(grpc.gateway.protoc_gen_swagger.options.openapiv2_field) =
{read_only: true}];

Doesn't work. "status" field still shows up in the request body
schema. Am I missing something here? Any help is greatly appreciated.

Thanks,
Raghu

PS. I hope this is the right group for grpc-gateway related questions.









I found that adding "// Output only" comment for the field works for
scalar types. However, this method doesn't work for structs. I then
stumbled upon "read_

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CALtL6Bc0wU4AFqAoA-uuzjxgOniXOXfF_7tu%3DQmj2SQvSXhUgw%40mail.gmail.com.

Reply via email to