A grpc-gateway/swagger question about "read_only" field

22 views
Skip to first unread message

Raghuram Devarakonda

unread,
Apr 8, 2020, 2:14:14 PM4/8/20
to grp...@googlegroups.com
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

zda...@google.com

unread,
Apr 15, 2020, 2:44:22 PM4/15/20
to grpc.io
You might as well file an issue at https://github.com/grpc-ecosystem/grpc-gateway/issues
Reply all
Reply to author
Forward
0 new messages