Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocService Add collapsible grpc request / response types #4481

Closed
Dogacel opened this issue Oct 13, 2022 · 4 comments · Fixed by #4484
Closed

DocService Add collapsible grpc request / response types #4481

Dogacel opened this issue Oct 13, 2022 · 4 comments · Fixed by #4484

Comments

@Dogacel
Copy link
Contributor

Dogacel commented Oct 13, 2022

Proto response/request types are not collapsible. I think they should automatically become collapsible because those types do not contain any valuable information and most of the time they are just {METHOD_NAME}Request and {METHOD_NAME}Response.

image

Example:
image

@Dogacel Dogacel changed the title DocService DocService Add collapsible grpc request / response types Oct 13, 2022
@minwoox
Copy link
Member

minwoox commented Oct 17, 2022

So do you mean we need to make the Parameters and Return Type sections collapsible?

@Dogacel
Copy link
Contributor Author

Dogacel commented Oct 17, 2022

I mean, we should be able to see the fields inside AddDishRequest and AddDishResponse in that single page as we do for Dish type. Because each RPC method has one request and one response type, it would save everyone a click.

Also the convention is not using primitives for requests/response types. For each rpc method XXX, the return type would be XXXResponse and request type would be XXXRequest. Google API Guide Buf Style Guide

@minwoox
Copy link
Member

minwoox commented Oct 17, 2022

Now I get what you meant. 😄
Thanks for the nice suggestion.
It perfectly makes sense if we use this DocService for a gRPC service only.
However, we also use this for an annotated service or a Thrift service which might have a bunch of parameters.
In that case, the unfolded structs would make the page cumbersome.

@Dogacel
Copy link
Contributor Author

Dogacel commented Oct 17, 2022

@minwoox makes sense, can we make this appear conditionally (e.g. show it only in grpc methods) by using some sort of boolean flag?

I also realized the section Exceptions is always empty (maybe I have missed something) for grpc methods, we can also hide that.

ikhoon pushed a commit that referenced this issue Nov 7, 2022
Motivation:

Especially for gRPC methods, not seeing the fields of parameters and return type is very frustrating. You should click and visit another page to see the parameters and the return type. It also makes using the `debug form` harder.

Modifications:

- Update `MethodPage` to have collapsible request and response types.

Result:

- Closes #4481 


https://user-images.githubusercontent.com/7023385/196294177-758e5b6a-9cb5-426a-afb8-85b54b5a6447.mov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants