From 2d9c2c0926798ac1ce179848adbff5404315e4d0 Mon Sep 17 00:00:00 2001 From: Rajiv Singh Date: Thu, 21 May 2020 20:56:27 +0530 Subject: [PATCH] Fix prose in customizingyourgateway.md (#1359) * improved customizingyourgateway.md * removed tabs * formatted go snippets in customizingyourgateway.md * Revert "formatted go snippets in customizingyourgateway.md" This reverts commit f80d90956bef63eb7b2005eddfd706054b5f57d2. deleted: .DS_Store deleted: docs/.DS_Store deleted: docs/_docs/.DS_Store modified: docs/_docs/customizingyourgateway.md * Revert "Revert "formatted go snippets in customizingyourgateway.md"" This reverts commit e3d2ad1829f9d5edbf04697e65d32a8da4aa4c48. * Revert "Revert "Revert "formatted go snippets in customizingyourgateway.md""" This reverts commit bab70451e8c8c23750fa74889e63ed94001d5f36. * formatted go snippet * reverted code * reverted changes * removed unwanted spaces --- docs/_docs/customizingyourgateway.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/_docs/customizingyourgateway.md b/docs/_docs/customizingyourgateway.md index 55e0a457661..581aa3daae9 100644 --- a/docs/_docs/customizingyourgateway.md +++ b/docs/_docs/customizingyourgateway.md @@ -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 @@ -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 { @@ -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). @@ -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