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

improved customizingyourgateway.md #1359

Merged
merged 10 commits into from
May 21, 2020
9 changes: 4 additions & 5 deletions docs/_docs/customizingyourgateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type Marshaler struct {

// A string to indent each level by. The presence of this field will
// also cause a space to appear between the field separator and
// value, and for newlines to be appear between fields and array
// value, and for newlines to appear between fields and array
// elements.
Indent string

Expand All @@ -79,8 +79,7 @@ also, this example code does not remove the query parameter `pretty` from furthe

## Customize unmarshaling per Content-Type

Having different unmarshaling options per Content-Type is possible by wrapping the decoder and
and passing that to `runtime.WithMarshalerOption`:
Having different unmarshaling options per Content-Type is possible by wrapping the decoder and passing that to `runtime.WithMarshalerOption`:

```go
type m struct {
Expand Down Expand Up @@ -303,7 +302,7 @@ to RPC methods that have a unary response.

When the method has a streaming response, grpc-gateway handles
that by emitting a newline-separated stream of "chunks". Each
chunk is an envelope that can container either a response message
chunk is an envelope that can contain either a response message
or an error. Only the last chunk will include an error, and only
when the RPC handler ends abnormally (i.e. with an error code).

Expand All @@ -317,7 +316,7 @@ mux := runtime.NewServeMux(
```

The signature of the handler is much more rigid because we need
to know the structure of the error payload in order to properly
to know the structure of the error payload to properly
encode the "chunk" schema into a Swagger/OpenAPI spec.

So the function must return a `*runtime.StreamError`. The handler
Expand Down