From 12909bbf049b5e7399b16894abf5355bb53834bb Mon Sep 17 00:00:00 2001 From: Johan Brandhorst-Satzkorn Date: Wed, 3 Jan 2024 11:31:38 -0800 Subject: [PATCH] Revert 4c79b45386348459926176911cb6b35f6f53dcdc Revert #3072 which introduced a regression in the handling of nested query parameters. Fixes #3848 --- .../internal/clients/echo/api/swagger.yaml | 214 ----------- .../internal/clients/echo/api_echo_service.go | 337 ------------------ .../echo/model_examplepb_simple_message.go | 1 - .../clients/unannotatedecho/api/swagger.yaml | 20 -- .../api_unannotated_echo_service.go | 15 - ...el_examplepb_unannotated_simple_message.go | 1 - .../internal/helloworld/helloworld.pb.gw.go | 20 +- .../internal/integration/integration_test.go | 75 +--- .../examplepb/a_bit_of_everything.pb.gw.go | 28 +- .../proto/examplepb/echo_service.pb.go | 195 +++++----- .../proto/examplepb/echo_service.pb.gw.go | 264 +------------- .../proto/examplepb/echo_service.proto | 6 - .../proto/examplepb/echo_service.swagger.json | 236 ------------ .../proto/examplepb/flow_combination.pb.gw.go | 28 +- .../examplepb/non_standard_names.pb.gw.go | 4 +- .../examplepb/unannotated_echo_service.pb.go | 77 ++-- .../unannotated_echo_service.pb.gw.go | 4 +- .../examplepb/unannotated_echo_service.proto | 1 - .../unannotated_echo_service.swagger.json | 21 -- .../visibility_rule_echo_service.pb.gw.go | 4 +- .../unannotated_echo_service.pb.gw.go | 10 +- .../internal/gengateway/template.go | 8 - 22 files changed, 180 insertions(+), 1389 deletions(-) diff --git a/examples/internal/clients/echo/api/swagger.yaml b/examples/internal/clients/echo/api/swagger.yaml index 03e677324a5..63642265c75 100644 --- a/examples/internal/clients/echo/api/swagger.yaml +++ b/examples/internal/clients/echo/api/swagger.yaml @@ -11,88 +11,6 @@ consumes: produces: - "application/json" paths: - /v1/example/echo/resource/{resourceId}: - get: - tags: - - "EchoService" - summary: "Echo method receives a simple message and returns it." - description: "The message posted as the id parameter will also be\nreturned." - operationId: "EchoService_Echo6" - parameters: - - name: "resourceId" - in: "path" - required: true - type: "string" - x-exportParamName: "ResourceId" - - name: "id" - in: "query" - description: "Id represents the message identifier." - required: false - type: "string" - x-exportParamName: "Id" - x-optionalDataType: "String" - - name: "num" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Num" - x-optionalDataType: "String" - - name: "lineNum" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "LineNum" - x-optionalDataType: "String" - - name: "lang" - in: "query" - required: false - type: "string" - x-exportParamName: "Lang" - x-optionalDataType: "String" - - name: "status.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "StatusProgress" - x-optionalDataType: "String" - - name: "status.note" - in: "query" - required: false - type: "string" - x-exportParamName: "StatusNote" - x-optionalDataType: "String" - - name: "en" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "En" - x-optionalDataType: "String" - - name: "no.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "NoProgress" - x-optionalDataType: "String" - - name: "no.note" - in: "query" - required: false - type: "string" - x-exportParamName: "NoNote" - x-optionalDataType: "String" - responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbSimpleMessage" - default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" /v1/example/echo/{id}: post: tags: @@ -160,12 +78,6 @@ paths: type: "string" x-exportParamName: "NoNote" x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" responses: 200: description: "A successful response." @@ -241,12 +153,6 @@ paths: type: "string" x-exportParamName: "NoNote" x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" responses: 200: description: "A successful response." @@ -321,12 +227,6 @@ paths: type: "string" x-exportParamName: "NoNote" x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" responses: 200: description: "A successful response." @@ -395,12 +295,6 @@ paths: format: "int64" x-exportParamName: "NoProgress" x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" responses: 200: description: "A successful response." @@ -471,12 +365,6 @@ paths: format: "int64" x-exportParamName: "NoProgress" x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" responses: 200: description: "A successful response." @@ -568,93 +456,6 @@ paths: format: "int64" x-exportParamName: "En" x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" - responses: - 200: - description: "A successful response." - schema: - $ref: "#/definitions/examplepbSimpleMessage" - default: - description: "An unexpected error response." - schema: - $ref: "#/definitions/rpcStatus" - /v1/example/echo_body2/{id}: - put: - tags: - - "EchoService" - summary: "EchoBody method receives a simple message and returns it." - operationId: "EchoService_EchoBody3" - parameters: - - name: "id" - in: "path" - description: "Id represents the message identifier." - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "resourceId" - required: true - schema: - type: "string" - x-exportParamName: "ResourceId" - - name: "num" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "Num" - x-optionalDataType: "String" - - name: "lineNum" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "LineNum" - x-optionalDataType: "String" - - name: "lang" - in: "query" - required: false - type: "string" - x-exportParamName: "Lang" - x-optionalDataType: "String" - - name: "status.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "StatusProgress" - x-optionalDataType: "String" - - name: "status.note" - in: "query" - required: false - type: "string" - x-exportParamName: "StatusNote" - x-optionalDataType: "String" - - name: "en" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "En" - x-optionalDataType: "String" - - name: "no.progress" - in: "query" - required: false - type: "string" - format: "int64" - x-exportParamName: "NoProgress" - x-optionalDataType: "String" - - name: "no.note" - in: "query" - required: false - type: "string" - x-exportParamName: "NoNote" - x-optionalDataType: "String" responses: 200: description: "A successful response." @@ -731,12 +532,6 @@ paths: type: "string" x-exportParamName: "NoNote" x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" responses: 200: description: "A successful response." @@ -837,12 +632,6 @@ paths: type: "string" x-exportParamName: "NoNote" x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" responses: 200: description: "A successful response." @@ -910,14 +699,11 @@ definitions: format: "int64" "no": $ref: "#/definitions/examplepbEmbedded" - resourceId: - type: "string" description: "SimpleMessage represents a simple message sent to the Echo service." example: "no": note: "note" progress: "progress" - resourceId: "resourceId" num: "num" lineNum: "lineNum" en: "en" diff --git a/examples/internal/clients/echo/api_echo_service.go b/examples/internal/clients/echo/api_echo_service.go index 2c0241e359c..c600199ccc2 100644 --- a/examples/internal/clients/echo/api_echo_service.go +++ b/examples/internal/clients/echo/api_echo_service.go @@ -40,7 +40,6 @@ The message posted as the id parameter will also be returned. * @param "En" (optional.String) - * @param "NoProgress" (optional.String) - * @param "NoNote" (optional.String) - - * @param "ResourceId" (optional.String) - @return ExamplepbSimpleMessage */ @@ -54,7 +53,6 @@ type EchoServiceEchoOpts struct { En optional.String NoProgress optional.String NoNote optional.String - ResourceId optional.String } func (a *EchoServiceApiService) EchoServiceEcho(ctx context.Context, id string, localVarOptionals *EchoServiceEchoOpts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -98,9 +96,6 @@ func (a *EchoServiceApiService) EchoServiceEcho(ctx context.Context, id string, if localVarOptionals != nil && localVarOptionals.NoNote.IsSet() { localVarQueryParams.Add("no.note", parameterToString(localVarOptionals.NoNote.Value(), "")) } - if localVarOptionals != nil && localVarOptionals.ResourceId.IsSet() { - localVarQueryParams.Add("resourceId", parameterToString(localVarOptionals.ResourceId.Value(), "")) - } // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json"} @@ -190,7 +185,6 @@ The message posted as the id parameter will also be returned. * @param "En" (optional.String) - * @param "NoProgress" (optional.String) - * @param "NoNote" (optional.String) - - * @param "ResourceId" (optional.String) - @return ExamplepbSimpleMessage */ @@ -203,7 +197,6 @@ type EchoServiceEcho2Opts struct { En optional.String NoProgress optional.String NoNote optional.String - ResourceId optional.String } func (a *EchoServiceApiService) EchoServiceEcho2(ctx context.Context, id string, num string, localVarOptionals *EchoServiceEcho2Opts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -245,9 +238,6 @@ func (a *EchoServiceApiService) EchoServiceEcho2(ctx context.Context, id string, if localVarOptionals != nil && localVarOptionals.NoNote.IsSet() { localVarQueryParams.Add("no.note", parameterToString(localVarOptionals.NoNote.Value(), "")) } - if localVarOptionals != nil && localVarOptionals.ResourceId.IsSet() { - localVarQueryParams.Add("resourceId", parameterToString(localVarOptionals.ResourceId.Value(), "")) - } // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json"} @@ -337,7 +327,6 @@ The message posted as the id parameter will also be returned. * @param "En" (optional.String) - * @param "NoProgress" (optional.String) - * @param "NoNote" (optional.String) - - * @param "ResourceId" (optional.String) - @return ExamplepbSimpleMessage */ @@ -349,7 +338,6 @@ type EchoServiceEcho3Opts struct { En optional.String NoProgress optional.String NoNote optional.String - ResourceId optional.String } func (a *EchoServiceApiService) EchoServiceEcho3(ctx context.Context, id string, num string, lang string, localVarOptionals *EchoServiceEcho3Opts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -389,9 +377,6 @@ func (a *EchoServiceApiService) EchoServiceEcho3(ctx context.Context, id string, if localVarOptionals != nil && localVarOptionals.NoNote.IsSet() { localVarQueryParams.Add("no.note", parameterToString(localVarOptionals.NoNote.Value(), "")) } - if localVarOptionals != nil && localVarOptionals.ResourceId.IsSet() { - localVarQueryParams.Add("resourceId", parameterToString(localVarOptionals.ResourceId.Value(), "")) - } // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json"} @@ -480,7 +465,6 @@ The message posted as the id parameter will also be returned. * @param "StatusProgress" (optional.String) - * @param "En" (optional.String) - * @param "NoProgress" (optional.String) - - * @param "ResourceId" (optional.String) - @return ExamplepbSimpleMessage */ @@ -491,7 +475,6 @@ type EchoServiceEcho4Opts struct { StatusProgress optional.String En optional.String NoProgress optional.String - ResourceId optional.String } func (a *EchoServiceApiService) EchoServiceEcho4(ctx context.Context, id string, lineNum string, statusNote string, localVarOptionals *EchoServiceEcho4Opts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -528,9 +511,6 @@ func (a *EchoServiceApiService) EchoServiceEcho4(ctx context.Context, id string, if localVarOptionals != nil && localVarOptionals.NoProgress.IsSet() { localVarQueryParams.Add("no.progress", parameterToString(localVarOptionals.NoProgress.Value(), "")) } - if localVarOptionals != nil && localVarOptionals.ResourceId.IsSet() { - localVarQueryParams.Add("resourceId", parameterToString(localVarOptionals.ResourceId.Value(), "")) - } // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json"} @@ -619,7 +599,6 @@ The message posted as the id parameter will also be returned. * @param "StatusProgress" (optional.String) - * @param "En" (optional.String) - * @param "NoProgress" (optional.String) - - * @param "ResourceId" (optional.String) - @return ExamplepbSimpleMessage */ @@ -632,7 +611,6 @@ type EchoServiceEcho5Opts struct { StatusProgress optional.String En optional.String NoProgress optional.String - ResourceId optional.String } func (a *EchoServiceApiService) EchoServiceEcho5(ctx context.Context, noNote string, localVarOptionals *EchoServiceEcho5Opts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -673,159 +651,6 @@ func (a *EchoServiceApiService) EchoServiceEcho5(ctx context.Context, noNote str if localVarOptionals != nil && localVarOptionals.NoProgress.IsSet() { localVarQueryParams.Add("no.progress", parameterToString(localVarOptionals.NoProgress.Value(), "")) } - if localVarOptionals != nil && localVarOptionals.ResourceId.IsSet() { - localVarQueryParams.Add("resourceId", parameterToString(localVarOptionals.ResourceId.Value(), "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() - if err != nil { - return localVarReturnValue, localVarHttpResponse, err - } - - if localVarHttpResponse.StatusCode < 300 { - // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } - } - - if localVarHttpResponse.StatusCode >= 300 { - newErr := GenericSwaggerError{ - body: localVarBody, - error: localVarHttpResponse.Status, - } - - if localVarHttpResponse.StatusCode == 200 { - var v ExamplepbSimpleMessage - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr - } - - if localVarHttpResponse.StatusCode == 0 { - var v RpcStatus - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr - } - - return localVarReturnValue, localVarHttpResponse, newErr - } - - return localVarReturnValue, localVarHttpResponse, nil -} - -/* -EchoServiceApiService Echo method receives a simple message and returns it. -The message posted as the id parameter will also be returned. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param resourceId - * @param optional nil or *EchoServiceEcho6Opts - Optional Parameters: - * @param "Id" (optional.String) - Id represents the message identifier. - * @param "Num" (optional.String) - - * @param "LineNum" (optional.String) - - * @param "Lang" (optional.String) - - * @param "StatusProgress" (optional.String) - - * @param "StatusNote" (optional.String) - - * @param "En" (optional.String) - - * @param "NoProgress" (optional.String) - - * @param "NoNote" (optional.String) - - -@return ExamplepbSimpleMessage -*/ - -type EchoServiceEcho6Opts struct { - Id optional.String - Num optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String -} - -func (a *EchoServiceApiService) EchoServiceEcho6(ctx context.Context, resourceId string, localVarOptionals *EchoServiceEcho6Opts) (ExamplepbSimpleMessage, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ExamplepbSimpleMessage - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v1/example/echo/resource/{resourceId}" - localVarPath = strings.Replace(localVarPath, "{"+"resourceId"+"}", fmt.Sprintf("%v", resourceId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if localVarOptionals != nil && localVarOptionals.Id.IsSet() { - localVarQueryParams.Add("id", parameterToString(localVarOptionals.Id.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Num.IsSet() { - localVarQueryParams.Add("num", parameterToString(localVarOptionals.Num.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.LineNum.IsSet() { - localVarQueryParams.Add("lineNum", parameterToString(localVarOptionals.LineNum.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Lang.IsSet() { - localVarQueryParams.Add("lang", parameterToString(localVarOptionals.Lang.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.StatusProgress.IsSet() { - localVarQueryParams.Add("status.progress", parameterToString(localVarOptionals.StatusProgress.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.StatusNote.IsSet() { - localVarQueryParams.Add("status.note", parameterToString(localVarOptionals.StatusNote.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.En.IsSet() { - localVarQueryParams.Add("en", parameterToString(localVarOptionals.En.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.NoProgress.IsSet() { - localVarQueryParams.Add("no.progress", parameterToString(localVarOptionals.NoProgress.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.NoNote.IsSet() { - localVarQueryParams.Add("no.note", parameterToString(localVarOptionals.NoNote.Value(), "")) - } // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json"} @@ -1013,7 +838,6 @@ EchoServiceApiService EchoBody method receives a simple message and returns it. * @param "StatusProgress" (optional.String) - * @param "StatusNote" (optional.String) - * @param "En" (optional.String) - - * @param "ResourceId" (optional.String) - @return ExamplepbSimpleMessage */ @@ -1025,7 +849,6 @@ type EchoServiceEchoBody2Opts struct { StatusProgress optional.String StatusNote optional.String En optional.String - ResourceId optional.String } func (a *EchoServiceApiService) EchoServiceEchoBody2(ctx context.Context, id string, no ExamplepbEmbedded, localVarOptionals *EchoServiceEchoBody2Opts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -1063,9 +886,6 @@ func (a *EchoServiceApiService) EchoServiceEchoBody2(ctx context.Context, id str if localVarOptionals != nil && localVarOptionals.En.IsSet() { localVarQueryParams.Add("en", parameterToString(localVarOptionals.En.Value(), "")) } - if localVarOptionals != nil && localVarOptionals.ResourceId.IsSet() { - localVarQueryParams.Add("resourceId", parameterToString(localVarOptionals.ResourceId.Value(), "")) - } // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json"} @@ -1143,153 +963,6 @@ func (a *EchoServiceApiService) EchoServiceEchoBody2(ctx context.Context, id str return localVarReturnValue, localVarHttpResponse, nil } -/* -EchoServiceApiService EchoBody method receives a simple message and returns it. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param id Id represents the message identifier. - * @param resourceId - * @param optional nil or *EchoServiceEchoBody3Opts - Optional Parameters: - * @param "Num" (optional.String) - - * @param "LineNum" (optional.String) - - * @param "Lang" (optional.String) - - * @param "StatusProgress" (optional.String) - - * @param "StatusNote" (optional.String) - - * @param "En" (optional.String) - - * @param "NoProgress" (optional.String) - - * @param "NoNote" (optional.String) - - -@return ExamplepbSimpleMessage -*/ - -type EchoServiceEchoBody3Opts struct { - Num optional.String - LineNum optional.String - Lang optional.String - StatusProgress optional.String - StatusNote optional.String - En optional.String - NoProgress optional.String - NoNote optional.String -} - -func (a *EchoServiceApiService) EchoServiceEchoBody3(ctx context.Context, id string, resourceId string, localVarOptionals *EchoServiceEchoBody3Opts) (ExamplepbSimpleMessage, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ExamplepbSimpleMessage - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v1/example/echo_body2/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if localVarOptionals != nil && localVarOptionals.Num.IsSet() { - localVarQueryParams.Add("num", parameterToString(localVarOptionals.Num.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.LineNum.IsSet() { - localVarQueryParams.Add("lineNum", parameterToString(localVarOptionals.LineNum.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Lang.IsSet() { - localVarQueryParams.Add("lang", parameterToString(localVarOptionals.Lang.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.StatusProgress.IsSet() { - localVarQueryParams.Add("status.progress", parameterToString(localVarOptionals.StatusProgress.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.StatusNote.IsSet() { - localVarQueryParams.Add("status.note", parameterToString(localVarOptionals.StatusNote.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.En.IsSet() { - localVarQueryParams.Add("en", parameterToString(localVarOptionals.En.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.NoProgress.IsSet() { - localVarQueryParams.Add("no.progress", parameterToString(localVarOptionals.NoProgress.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.NoNote.IsSet() { - localVarQueryParams.Add("no.note", parameterToString(localVarOptionals.NoNote.Value(), "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - localVarPostBody = &resourceId - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() - if err != nil { - return localVarReturnValue, localVarHttpResponse, err - } - - if localVarHttpResponse.StatusCode < 300 { - // If we succeed, return the data, otherwise pass on to decode error. - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } - } - - if localVarHttpResponse.StatusCode >= 300 { - newErr := GenericSwaggerError{ - body: localVarBody, - error: localVarHttpResponse.Status, - } - - if localVarHttpResponse.StatusCode == 200 { - var v ExamplepbSimpleMessage - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr - } - - if localVarHttpResponse.StatusCode == 0 { - var v RpcStatus - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr - } - - return localVarReturnValue, localVarHttpResponse, newErr - } - - return localVarReturnValue, localVarHttpResponse, nil -} - /* EchoServiceApiService EchoDelete method receives a simple message and returns it. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -1303,7 +976,6 @@ EchoServiceApiService EchoDelete method receives a simple message and returns it * @param "En" (optional.String) - * @param "NoProgress" (optional.String) - * @param "NoNote" (optional.String) - - * @param "ResourceId" (optional.String) - @return ExamplepbSimpleMessage */ @@ -1318,7 +990,6 @@ type EchoServiceEchoDeleteOpts struct { En optional.String NoProgress optional.String NoNote optional.String - ResourceId optional.String } func (a *EchoServiceApiService) EchoServiceEchoDelete(ctx context.Context, localVarOptionals *EchoServiceEchoDeleteOpts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -1364,9 +1035,6 @@ func (a *EchoServiceApiService) EchoServiceEchoDelete(ctx context.Context, local if localVarOptionals != nil && localVarOptionals.NoNote.IsSet() { localVarQueryParams.Add("no.note", parameterToString(localVarOptionals.NoNote.Value(), "")) } - if localVarOptionals != nil && localVarOptionals.ResourceId.IsSet() { - localVarQueryParams.Add("resourceId", parameterToString(localVarOptionals.ResourceId.Value(), "")) - } // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json"} @@ -1555,7 +1223,6 @@ EchoServiceApiService EchoUnauthorized method receives a simple message and retu * @param "En" (optional.String) - * @param "NoProgress" (optional.String) - * @param "NoNote" (optional.String) - - * @param "ResourceId" (optional.String) - @return ExamplepbSimpleMessage */ @@ -1570,7 +1237,6 @@ type EchoServiceEchoUnauthorizedOpts struct { En optional.String NoProgress optional.String NoNote optional.String - ResourceId optional.String } func (a *EchoServiceApiService) EchoServiceEchoUnauthorized(ctx context.Context, localVarOptionals *EchoServiceEchoUnauthorizedOpts) (ExamplepbSimpleMessage, *http.Response, error) { @@ -1616,9 +1282,6 @@ func (a *EchoServiceApiService) EchoServiceEchoUnauthorized(ctx context.Context, if localVarOptionals != nil && localVarOptionals.NoNote.IsSet() { localVarQueryParams.Add("no.note", parameterToString(localVarOptionals.NoNote.Value(), "")) } - if localVarOptionals != nil && localVarOptionals.ResourceId.IsSet() { - localVarQueryParams.Add("resourceId", parameterToString(localVarOptionals.ResourceId.Value(), "")) - } // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json"} diff --git a/examples/internal/clients/echo/model_examplepb_simple_message.go b/examples/internal/clients/echo/model_examplepb_simple_message.go index 1c9bbcac15f..9b029fa0a57 100644 --- a/examples/internal/clients/echo/model_examplepb_simple_message.go +++ b/examples/internal/clients/echo/model_examplepb_simple_message.go @@ -19,5 +19,4 @@ type ExamplepbSimpleMessage struct { Status *ExamplepbEmbedded `json:"status,omitempty"` En string `json:"en,omitempty"` No *ExamplepbEmbedded `json:"no,omitempty"` - ResourceId string `json:"resourceId,omitempty"` } diff --git a/examples/internal/clients/unannotatedecho/api/swagger.yaml b/examples/internal/clients/unannotatedecho/api/swagger.yaml index b495bb27c5f..e423238be01 100644 --- a/examples/internal/clients/unannotatedecho/api/swagger.yaml +++ b/examples/internal/clients/unannotatedecho/api/swagger.yaml @@ -119,12 +119,6 @@ paths: type: "string" x-exportParamName: "NoNote" x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" responses: 200: description: "A successful response." @@ -227,12 +221,6 @@ paths: type: "string" x-exportParamName: "NoNote" x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" responses: 200: description: "A successful response." @@ -367,12 +355,6 @@ paths: type: "string" x-exportParamName: "NoNote" x-optionalDataType: "String" - - name: "resourceId" - in: "query" - required: false - type: "string" - x-exportParamName: "ResourceId" - x-optionalDataType: "String" responses: 200: description: "A successful response." @@ -440,8 +422,6 @@ definitions: format: "int64" "no": $ref: "#/definitions/examplepbUnannotatedEmbedded" - resourceId: - type: "string" externalDocs: description: "Find out more about UnannotatedSimpleMessage" url: "https://github.com/grpc-ecosystem/grpc-gateway" diff --git a/examples/internal/clients/unannotatedecho/api_unannotated_echo_service.go b/examples/internal/clients/unannotatedecho/api_unannotated_echo_service.go index f05da2b2751..70697ae6749 100644 --- a/examples/internal/clients/unannotatedecho/api_unannotated_echo_service.go +++ b/examples/internal/clients/unannotatedecho/api_unannotated_echo_service.go @@ -42,7 +42,6 @@ Description Echo * @param "En" (optional.String) - * @param "NoProgress" (optional.String) - * @param "NoNote" (optional.String) - - * @param "ResourceId" (optional.String) - @return ExamplepbUnannotatedSimpleMessage */ @@ -56,7 +55,6 @@ type UnannotatedEchoServiceEchoOpts struct { En optional.String NoProgress optional.String NoNote optional.String - ResourceId optional.String } func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx context.Context, id string, num string, localVarOptionals *UnannotatedEchoServiceEchoOpts) (ExamplepbUnannotatedSimpleMessage, *http.Response, error) { @@ -101,9 +99,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho(ctx contex if localVarOptionals != nil && localVarOptionals.NoNote.IsSet() { localVarQueryParams.Add("no.note", parameterToString(localVarOptionals.NoNote.Value(), "")) } - if localVarOptionals != nil && localVarOptionals.ResourceId.IsSet() { - localVarQueryParams.Add("resourceId", parameterToString(localVarOptionals.ResourceId.Value(), "")) - } // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} @@ -240,7 +235,6 @@ Description Echo * @param "En" (optional.String) - * @param "NoProgress" (optional.String) - * @param "NoNote" (optional.String) - - * @param "ResourceId" (optional.String) - @return ExamplepbUnannotatedSimpleMessage */ @@ -254,7 +248,6 @@ type UnannotatedEchoServiceEcho2Opts struct { En optional.String NoProgress optional.String NoNote optional.String - ResourceId optional.String } func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx context.Context, id string, num string, localVarOptionals *UnannotatedEchoServiceEcho2Opts) (ExamplepbUnannotatedSimpleMessage, *http.Response, error) { @@ -299,9 +292,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEcho2(ctx conte if localVarOptionals != nil && localVarOptionals.NoNote.IsSet() { localVarQueryParams.Add("no.note", parameterToString(localVarOptionals.NoNote.Value(), "")) } - if localVarOptionals != nil && localVarOptionals.ResourceId.IsSet() { - localVarQueryParams.Add("resourceId", parameterToString(localVarOptionals.ResourceId.Value(), "")) - } // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} @@ -572,7 +562,6 @@ UnannotatedEchoServiceApiService EchoDelete method receives a simple message and * @param "En" (optional.String) - * @param "NoProgress" (optional.String) - * @param "NoNote" (optional.String) - - * @param "ResourceId" (optional.String) - @return ExamplepbUnannotatedSimpleMessage */ @@ -587,7 +576,6 @@ type UnannotatedEchoServiceEchoDeleteOpts struct { En optional.String NoProgress optional.String NoNote optional.String - ResourceId optional.String } func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx context.Context, num string, localVarOptionals *UnannotatedEchoServiceEchoDeleteOpts) (ExamplepbUnannotatedSimpleMessage, *http.Response, error) { @@ -634,9 +622,6 @@ func (a *UnannotatedEchoServiceApiService) UnannotatedEchoServiceEchoDelete(ctx if localVarOptionals != nil && localVarOptionals.NoNote.IsSet() { localVarQueryParams.Add("no.note", parameterToString(localVarOptionals.NoNote.Value(), "")) } - if localVarOptionals != nil && localVarOptionals.ResourceId.IsSet() { - localVarQueryParams.Add("resourceId", parameterToString(localVarOptionals.ResourceId.Value(), "")) - } // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} diff --git a/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_simple_message.go b/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_simple_message.go index c38d3449186..07045bc1dbc 100644 --- a/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_simple_message.go +++ b/examples/internal/clients/unannotatedecho/model_examplepb_unannotated_simple_message.go @@ -22,5 +22,4 @@ type ExamplepbUnannotatedSimpleMessage struct { Status *ExamplepbUnannotatedEmbedded `json:"status,omitempty"` En string `json:"en,omitempty"` No *ExamplepbUnannotatedEmbedded `json:"no,omitempty"` - ResourceId string `json:"resourceId,omitempty"` } diff --git a/examples/internal/helloworld/helloworld.pb.gw.go b/examples/internal/helloworld/helloworld.pb.gw.go index e67370f7773..385730e289a 100644 --- a/examples/internal/helloworld/helloworld.pb.gw.go +++ b/examples/internal/helloworld/helloworld.pb.gw.go @@ -32,7 +32,7 @@ var _ = utilities.NewDoubleArray var _ = metadata.Join var ( - filter_Greeter_SayHello_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_Greeter_SayHello_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_Greeter_SayHello_0(ctx context.Context, marshaler runtime.Marshaler, client GreeterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -102,7 +102,7 @@ func local_request_Greeter_SayHello_0(ctx context.Context, marshaler runtime.Mar } var ( - filter_Greeter_SayHello_1 = &utilities.DoubleArray{Encoding: map[string]int{"strVal": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_Greeter_SayHello_1 = &utilities.DoubleArray{Encoding: map[string]int{"strVal": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_Greeter_SayHello_1(ctx context.Context, marshaler runtime.Marshaler, client GreeterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -172,7 +172,7 @@ func local_request_Greeter_SayHello_1(ctx context.Context, marshaler runtime.Mar } var ( - filter_Greeter_SayHello_2 = &utilities.DoubleArray{Encoding: map[string]int{"floatVal": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_Greeter_SayHello_2 = &utilities.DoubleArray{Encoding: map[string]int{"floatVal": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_Greeter_SayHello_2(ctx context.Context, marshaler runtime.Marshaler, client GreeterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -242,7 +242,7 @@ func local_request_Greeter_SayHello_2(ctx context.Context, marshaler runtime.Mar } var ( - filter_Greeter_SayHello_3 = &utilities.DoubleArray{Encoding: map[string]int{"doubleVal": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_Greeter_SayHello_3 = &utilities.DoubleArray{Encoding: map[string]int{"doubleVal": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_Greeter_SayHello_3(ctx context.Context, marshaler runtime.Marshaler, client GreeterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -312,7 +312,7 @@ func local_request_Greeter_SayHello_3(ctx context.Context, marshaler runtime.Mar } var ( - filter_Greeter_SayHello_4 = &utilities.DoubleArray{Encoding: map[string]int{"boolVal": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_Greeter_SayHello_4 = &utilities.DoubleArray{Encoding: map[string]int{"boolVal": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_Greeter_SayHello_4(ctx context.Context, marshaler runtime.Marshaler, client GreeterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -382,7 +382,7 @@ func local_request_Greeter_SayHello_4(ctx context.Context, marshaler runtime.Mar } var ( - filter_Greeter_SayHello_5 = &utilities.DoubleArray{Encoding: map[string]int{"bytesVal": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_Greeter_SayHello_5 = &utilities.DoubleArray{Encoding: map[string]int{"bytesVal": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_Greeter_SayHello_5(ctx context.Context, marshaler runtime.Marshaler, client GreeterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -452,7 +452,7 @@ func local_request_Greeter_SayHello_5(ctx context.Context, marshaler runtime.Mar } var ( - filter_Greeter_SayHello_6 = &utilities.DoubleArray{Encoding: map[string]int{"int32Val": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_Greeter_SayHello_6 = &utilities.DoubleArray{Encoding: map[string]int{"int32Val": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_Greeter_SayHello_6(ctx context.Context, marshaler runtime.Marshaler, client GreeterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -522,7 +522,7 @@ func local_request_Greeter_SayHello_6(ctx context.Context, marshaler runtime.Mar } var ( - filter_Greeter_SayHello_7 = &utilities.DoubleArray{Encoding: map[string]int{"uint32Val": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_Greeter_SayHello_7 = &utilities.DoubleArray{Encoding: map[string]int{"uint32Val": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_Greeter_SayHello_7(ctx context.Context, marshaler runtime.Marshaler, client GreeterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -592,7 +592,7 @@ func local_request_Greeter_SayHello_7(ctx context.Context, marshaler runtime.Mar } var ( - filter_Greeter_SayHello_8 = &utilities.DoubleArray{Encoding: map[string]int{"int64Val": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_Greeter_SayHello_8 = &utilities.DoubleArray{Encoding: map[string]int{"int64Val": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_Greeter_SayHello_8(ctx context.Context, marshaler runtime.Marshaler, client GreeterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -662,7 +662,7 @@ func local_request_Greeter_SayHello_8(ctx context.Context, marshaler runtime.Mar } var ( - filter_Greeter_SayHello_9 = &utilities.DoubleArray{Encoding: map[string]int{"uint64Val": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_Greeter_SayHello_9 = &utilities.DoubleArray{Encoding: map[string]int{"uint64Val": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_Greeter_SayHello_9(ctx context.Context, marshaler runtime.Marshaler, client GreeterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/examples/internal/integration/integration_test.go b/examples/internal/integration/integration_test.go index 5f959c5c2fa..3a1ce07d1bd 100644 --- a/examples/internal/integration/integration_test.go +++ b/examples/internal/integration/integration_test.go @@ -46,13 +46,11 @@ func TestEcho(t *testing.T) { testEchoOneof(t, 8088, apiPrefix, "application/json") testEchoOneof1(t, 8088, apiPrefix, "application/json") testEchoOneof2(t, 8088, apiPrefix, "application/json") - testEchoPathParamOverwrite(t, 8088) testEchoBody(t, 8088, apiPrefix, true) testEchoBody(t, 8088, apiPrefix, false) // Use SendHeader/SetTrailer without gRPC server https://github.com/grpc-ecosystem/grpc-gateway/issues/517#issuecomment-684625645 testEchoBody(t, 8089, apiPrefix, true) testEchoBody(t, 8089, apiPrefix, false) - testEchoBodyParamOverwrite(t, 8088) testEchoWithNonASCIIHeaderValues(t, 8088, apiPrefix) testEchoWithInvalidHeaderKey(t, 8088, apiPrefix) }) @@ -351,37 +349,8 @@ func testEchoOneof2(t *testing.T, port int, apiPrefix string, contentType string } } -func testEchoPathParamOverwrite(t *testing.T, port int) { - apiURL := fmt.Sprintf("http://localhost:%d/v1/example/echo/resource/my_resource_id?resourceId=bad_resource_id", port) - resp, err := http.Get(apiURL) - if err != nil { - t.Errorf("http.Get(%q) failed with %v; want success", apiURL, err) - return - } - defer resp.Body.Close() - buf, err := io.ReadAll(resp.Body) - if err != nil { - t.Errorf("io.ReadAll(resp.Body) failed with %v; want success", err) - return - } - - if got, want := resp.StatusCode, http.StatusOK; got != want { - t.Errorf("resp.StatusCode = %d; want %d", got, want) - t.Logf("%s", buf) - } - - msg := new(examplepb.UnannotatedSimpleMessage) - if err := marshaler.Unmarshal(buf, msg); err != nil { - t.Errorf("marshaler.Unmarshal(%s, msg) failed with %v; want success", buf, err) - return - } - if got, want := msg.GetResourceId(), "my_resource_id"; got != want { - t.Errorf("msg.GetResourceId() = %q; want %q", got, want) - } -} - func testEchoBody(t *testing.T, port int, apiPrefix string, useTrailers bool) { - sent := examplepb.UnannotatedSimpleMessage{Id: "example", ResourceId: "my_resource_id"} + sent := examplepb.UnannotatedSimpleMessage{Id: "example"} payload, err := marshaler.Marshal(&sent) if err != nil { t.Fatalf("marshaler.Marshal(%#v) failed with %v; want success", payload, err) @@ -446,48 +415,6 @@ func testEchoBody(t *testing.T, port int, apiPrefix string, useTrailers bool) { } } -func testEchoBodyParamOverwrite(t *testing.T, port int) { - sent := "my_resource_id" - payload, err := marshaler.Marshal(&sent) - if err != nil { - t.Fatalf("marshaler.Marshal(%#v) failed with %v; want success", payload, err) - } - - apiURL := fmt.Sprintf("http://localhost:%d/v1/example/echo_body2/%s?resourceId=bad_resource_id", port, "my_id") - - req, err := http.NewRequest("PUT", apiURL, bytes.NewReader(payload)) - if err != nil { - t.Errorf("http.NewRequest() failed with %v; want success", err) - return - } - - resp, err := http.DefaultClient.Do(req) - if err != nil { - t.Errorf("client.Do(%v) failed with %v; want success", req, err) - return - } - defer resp.Body.Close() - buf, err := io.ReadAll(resp.Body) - if err != nil { - t.Errorf("io.ReadAll(resp.Body) failed with %v; want success", err) - return - } - - if got, want := resp.StatusCode, http.StatusOK; got != want { - t.Errorf("resp.StatusCode = %d; want %d", got, want) - t.Logf("%s", buf) - } - - var received examplepb.UnannotatedSimpleMessage - if err := marshaler.Unmarshal(buf, &received); err != nil { - t.Errorf("marshaler.Unmarshal(%s, msg) failed with %v; want success", buf, err) - return - } - if diff := cmp.Diff(&received.ResourceId, &sent, protocmp.Transform()); diff != "" { - t.Errorf(diff) - } -} - func TestABE(t *testing.T) { if testing.Short() { t.Skip() diff --git a/examples/internal/proto/examplepb/a_bit_of_everything.pb.gw.go b/examples/internal/proto/examplepb/a_bit_of_everything.pb.gw.go index f5f9117eaa6..bbeedc1e8fe 100644 --- a/examples/internal/proto/examplepb/a_bit_of_everything.pb.gw.go +++ b/examples/internal/proto/examplepb/a_bit_of_everything.pb.gw.go @@ -37,7 +37,7 @@ var _ = utilities.NewDoubleArray var _ = metadata.Join var ( - filter_ABitOfEverythingService_Create_0 = &utilities.DoubleArray{Encoding: map[string]int{"float_value": 0, "floatValue": 1, "double_value": 2, "doubleValue": 3, "int64_value": 4, "int64Value": 5, "uint64_value": 6, "uint64Value": 7, "int32_value": 8, "int32Value": 9, "fixed64_value": 10, "fixed64Value": 11, "fixed32_value": 12, "fixed32Value": 13, "bool_value": 14, "boolValue": 15, "string_value": 16, "stringValue": 17, "uint32_value": 18, "uint32Value": 19, "sfixed32_value": 20, "sfixed32Value": 21, "sfixed64_value": 22, "sfixed64Value": 23, "sint32_value": 24, "sint32Value": 25, "sint64_value": 26, "sint64Value": 27, "nonConventionalNameValue": 28, "enum_value": 29, "enumValue": 30, "path_enum_value": 31, "pathEnumValue": 32, "nested_path_enum_value": 33, "nestedPathEnumValue": 34, "enum_value_annotation": 35, "enumValueAnnotation": 36}, Base: []int{1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 35, 36, 37, 38}} + filter_ABitOfEverythingService_Create_0 = &utilities.DoubleArray{Encoding: map[string]int{"float_value": 0, "double_value": 1, "int64_value": 2, "uint64_value": 3, "int32_value": 4, "fixed64_value": 5, "fixed32_value": 6, "bool_value": 7, "string_value": 8, "uint32_value": 9, "sfixed32_value": 10, "sfixed64_value": 11, "sint32_value": 12, "sint64_value": 13, "nonConventionalNameValue": 14, "enum_value": 15, "path_enum_value": 16, "nested_path_enum_value": 17, "enum_value_annotation": 18}, Base: []int{1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}} ) func request_ABitOfEverythingService_Create_0(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -511,7 +511,7 @@ func local_request_ABitOfEverythingService_CreateBody_0(ctx context.Context, mar } var ( - filter_ABitOfEverythingService_CreateBook_0 = &utilities.DoubleArray{Encoding: map[string]int{"book": 0, "parent": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} + filter_ABitOfEverythingService_CreateBook_0 = &utilities.DoubleArray{Encoding: map[string]int{"book": 0, "parent": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ) func request_ABitOfEverythingService_CreateBook_0(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -589,7 +589,7 @@ func local_request_ABitOfEverythingService_CreateBook_0(ctx context.Context, mar } var ( - filter_ABitOfEverythingService_UpdateBook_0 = &utilities.DoubleArray{Encoding: map[string]int{"book": 0, "name": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} + filter_ABitOfEverythingService_UpdateBook_0 = &utilities.DoubleArray{Encoding: map[string]int{"book": 0, "name": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}} ) func request_ABitOfEverythingService_UpdateBook_0(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -741,7 +741,7 @@ func local_request_ABitOfEverythingService_Lookup_0(ctx context.Context, marshal } var ( - filter_ABitOfEverythingService_Custom_0 = &utilities.DoubleArray{Encoding: map[string]int{"uuid": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_ABitOfEverythingService_Custom_0 = &utilities.DoubleArray{Encoding: map[string]int{"uuid": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_ABitOfEverythingService_Custom_0(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -811,7 +811,7 @@ func local_request_ABitOfEverythingService_Custom_0(ctx context.Context, marshal } var ( - filter_ABitOfEverythingService_DoubleColon_0 = &utilities.DoubleArray{Encoding: map[string]int{"uuid": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_ABitOfEverythingService_DoubleColon_0 = &utilities.DoubleArray{Encoding: map[string]int{"uuid": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_ABitOfEverythingService_DoubleColon_0(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -941,7 +941,7 @@ func local_request_ABitOfEverythingService_Update_0(ctx context.Context, marshal } var ( - filter_ABitOfEverythingService_UpdateV2_0 = &utilities.DoubleArray{Encoding: map[string]int{"abe": 0, "uuid": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} + filter_ABitOfEverythingService_UpdateV2_0 = &utilities.DoubleArray{Encoding: map[string]int{"abe": 0, "uuid": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}} ) func request_ABitOfEverythingService_UpdateV2_0(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -1019,7 +1019,7 @@ func local_request_ABitOfEverythingService_UpdateV2_0(ctx context.Context, marsh } var ( - filter_ABitOfEverythingService_UpdateV2_1 = &utilities.DoubleArray{Encoding: map[string]int{"abe": 0, "uuid": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} + filter_ABitOfEverythingService_UpdateV2_1 = &utilities.DoubleArray{Encoding: map[string]int{"abe": 0, "uuid": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}} ) func request_ABitOfEverythingService_UpdateV2_1(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -1231,7 +1231,7 @@ func local_request_ABitOfEverythingService_Delete_0(ctx context.Context, marshal } var ( - filter_ABitOfEverythingService_GetQuery_0 = &utilities.DoubleArray{Encoding: map[string]int{"uuid": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_ABitOfEverythingService_GetQuery_0 = &utilities.DoubleArray{Encoding: map[string]int{"uuid": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_ABitOfEverythingService_GetQuery_0(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -1997,7 +1997,7 @@ func local_request_ABitOfEverythingService_PostWithEmptyBody_0(ctx context.Conte } var ( - filter_ABitOfEverythingService_CheckGetQueryParams_0 = &utilities.DoubleArray{Encoding: map[string]int{"single_nested": 0, "name": 1}, Base: []int{1, 2, 3, 2, 0, 0}, Check: []int{0, 1, 1, 2, 4, 3}} + filter_ABitOfEverythingService_CheckGetQueryParams_0 = &utilities.DoubleArray{Encoding: map[string]int{"single_nested": 0, "name": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} ) func request_ABitOfEverythingService_CheckGetQueryParams_0(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -2067,7 +2067,7 @@ func local_request_ABitOfEverythingService_CheckGetQueryParams_0(ctx context.Con } var ( - filter_ABitOfEverythingService_CheckNestedEnumGetQueryParams_0 = &utilities.DoubleArray{Encoding: map[string]int{"single_nested": 0, "ok": 1}, Base: []int{1, 2, 3, 2, 0, 0}, Check: []int{0, 1, 1, 2, 4, 3}} + filter_ABitOfEverythingService_CheckNestedEnumGetQueryParams_0 = &utilities.DoubleArray{Encoding: map[string]int{"single_nested": 0, "ok": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} ) func request_ABitOfEverythingService_CheckNestedEnumGetQueryParams_0(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -2153,7 +2153,7 @@ func local_request_ABitOfEverythingService_CheckNestedEnumGetQueryParams_0(ctx c } var ( - filter_ABitOfEverythingService_CheckPostQueryParams_0 = &utilities.DoubleArray{Encoding: map[string]int{"single_nested": 0, "singleNested": 1, "string_value": 2, "stringValue": 3}, Base: []int{1, 1, 2, 3, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 1, 2, 3, 4, 5}} + filter_ABitOfEverythingService_CheckPostQueryParams_0 = &utilities.DoubleArray{Encoding: map[string]int{"single_nested": 0, "string_value": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ) func request_ABitOfEverythingService_CheckPostQueryParams_0(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -2409,7 +2409,7 @@ func local_request_ABitOfEverythingService_CheckStatus_0(ctx context.Context, ma } var ( - filter_ABitOfEverythingService_Exists_0 = &utilities.DoubleArray{Encoding: map[string]int{"uuid": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_ABitOfEverythingService_Exists_0 = &utilities.DoubleArray{Encoding: map[string]int{"uuid": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_ABitOfEverythingService_Exists_0(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -2479,7 +2479,7 @@ func local_request_ABitOfEverythingService_Exists_0(ctx context.Context, marshal } var ( - filter_ABitOfEverythingService_CustomOptionsRequest_0 = &utilities.DoubleArray{Encoding: map[string]int{"uuid": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_ABitOfEverythingService_CustomOptionsRequest_0 = &utilities.DoubleArray{Encoding: map[string]int{"uuid": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_ABitOfEverythingService_CustomOptionsRequest_0(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -2549,7 +2549,7 @@ func local_request_ABitOfEverythingService_CustomOptionsRequest_0(ctx context.Co } var ( - filter_ABitOfEverythingService_TraceRequest_0 = &utilities.DoubleArray{Encoding: map[string]int{"uuid": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_ABitOfEverythingService_TraceRequest_0 = &utilities.DoubleArray{Encoding: map[string]int{"uuid": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_ABitOfEverythingService_TraceRequest_0(ctx context.Context, marshaler runtime.Marshaler, client ABitOfEverythingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/examples/internal/proto/examplepb/echo_service.pb.go b/examples/internal/proto/examplepb/echo_service.pb.go index 76f69d40bbb..c4b1eade183 100644 --- a/examples/internal/proto/examplepb/echo_service.pb.go +++ b/examples/internal/proto/examplepb/echo_service.pb.go @@ -129,8 +129,7 @@ type SimpleMessage struct { // // *SimpleMessage_En // *SimpleMessage_No - Ext isSimpleMessage_Ext `protobuf_oneof:"ext"` - ResourceId string `protobuf:"bytes,8,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` + Ext isSimpleMessage_Ext `protobuf_oneof:"ext"` } func (x *SimpleMessage) Reset() { @@ -228,13 +227,6 @@ func (x *SimpleMessage) GetNo() *Embedded { return nil } -func (x *SimpleMessage) GetResourceId() string { - if x != nil { - return x.ResourceId - } - return "" -} - type isSimpleMessage_Code interface { isSimpleMessage_Code() } @@ -398,7 +390,7 @@ var file_examples_internal_proto_examplepb_echo_service_proto_rawDesc = []byte{ 0x12, 0x1c, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x04, 0x6e, 0x6f, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, - 0x6e, 0x6f, 0x74, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0xc4, 0x02, 0x0a, + 0x6e, 0x6f, 0x74, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0xa3, 0x02, 0x0a, 0x0d, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, @@ -416,92 +408,28 @@ var file_examples_internal_proto_examplepb_echo_service_proto_rawDesc = []byte{ 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x48, 0x01, 0x52, - 0x02, 0x6e, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x49, 0x64, 0x42, 0x06, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x42, 0x05, 0x0a, 0x03, - 0x65, 0x78, 0x74, 0x22, 0x85, 0x01, 0x0a, 0x0e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3a, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, - 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, - 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x12, 0x37, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x22, 0xa7, 0x01, 0x0a, 0x14, - 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x12, 0x52, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, - 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x70, 0x62, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x32, 0x9a, 0x09, 0x0a, 0x0b, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xe7, 0x02, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x3d, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, - 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x3d, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x53, - 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xe0, 0x01, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0xd9, 0x01, 0x5a, 0x1d, 0x12, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, - 0x7b, 0x6e, 0x75, 0x6d, 0x7d, 0x5a, 0x24, 0x12, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x7b, - 0x6e, 0x75, 0x6d, 0x7d, 0x2f, 0x7b, 0x6c, 0x61, 0x6e, 0x67, 0x7d, 0x5a, 0x31, 0x12, 0x2f, 0x2f, - 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x31, - 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x7b, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x7d, - 0x2f, 0x7b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x6e, 0x6f, 0x74, 0x65, 0x7d, 0x5a, 0x1d, - 0x12, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, - 0x68, 0x6f, 0x32, 0x2f, 0x7b, 0x6e, 0x6f, 0x2e, 0x6e, 0x6f, 0x74, 0x65, 0x7d, 0x5a, 0x29, 0x12, - 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, - 0x6f, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x22, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, - 0xf8, 0x01, 0x0a, 0x08, 0x45, 0x63, 0x68, 0x6f, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3d, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x69, - 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x3d, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x6d, - 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x6e, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x68, 0x3a, 0x01, 0x2a, 0x5a, 0x20, 0x3a, 0x02, 0x6e, 0x6f, 0x1a, 0x1a, 0x2f, 0x76, 0x31, - 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x5f, 0x62, 0x6f, - 0x64, 0x79, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x5a, 0x2a, 0x3a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x1a, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x32, 0x2f, 0x7b, - 0x69, 0x64, 0x7d, 0x22, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x12, 0xab, 0x01, 0x0a, 0x0a, 0x45, - 0x63, 0x68, 0x6f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x3d, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, - 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x3d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, - 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x2a, - 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, - 0x6f, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0xbd, 0x01, 0x0a, 0x09, 0x45, 0x63, 0x68, - 0x6f, 0x50, 0x61, 0x74, 0x63, 0x68, 0x12, 0x44, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, - 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x1a, 0x44, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x44, 0x79, - 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x32, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, - 0x68, 0x6f, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x12, 0xb7, 0x01, 0x0a, 0x10, 0x45, 0x63, 0x68, - 0x6f, 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x3d, 0x2e, + 0x02, 0x6e, 0x6f, 0x42, 0x06, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x42, 0x05, 0x0a, 0x03, 0x65, + 0x78, 0x74, 0x22, 0x85, 0x01, 0x0a, 0x0e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3a, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x12, 0x37, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x22, 0xa7, 0x01, 0x0a, 0x14, 0x44, + 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x12, 0x52, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x3e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x70, 0x62, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x4d, 0x61, 0x73, 0x6b, 0x32, 0xc3, 0x08, 0x0a, 0x0b, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0xbc, 0x02, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x3d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x53, @@ -509,15 +437,72 @@ var file_examples_internal_proto_examplepb_echo_service_proto_rawDesc = []byte{ 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x69, - 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x5f, 0x75, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, - 0x65, 0x64, 0x42, 0x4d, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, - 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x76, 0x32, 0x2f, - 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xb5, 0x01, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0xae, 0x01, 0x5a, 0x1d, 0x12, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x7b, + 0x6e, 0x75, 0x6d, 0x7d, 0x5a, 0x24, 0x12, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x7b, 0x6e, + 0x75, 0x6d, 0x7d, 0x2f, 0x7b, 0x6c, 0x61, 0x6e, 0x67, 0x7d, 0x5a, 0x31, 0x12, 0x2f, 0x2f, 0x76, + 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x31, 0x2f, + 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x7b, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x7d, 0x2f, + 0x7b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x6e, 0x6f, 0x74, 0x65, 0x7d, 0x5a, 0x1d, 0x12, + 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, + 0x6f, 0x32, 0x2f, 0x7b, 0x6e, 0x6f, 0x2e, 0x6e, 0x6f, 0x74, 0x65, 0x7d, 0x22, 0x15, 0x2f, 0x76, + 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x2f, 0x7b, + 0x69, 0x64, 0x7d, 0x12, 0xcc, 0x01, 0x0a, 0x08, 0x45, 0x63, 0x68, 0x6f, 0x42, 0x6f, 0x64, 0x79, + 0x12, 0x3d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, + 0x62, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, + 0x3d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, + 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x42, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3c, 0x3a, 0x01, 0x2a, 0x5a, 0x20, 0x3a, 0x02, 0x6e, 0x6f, 0x1a, + 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, + 0x6f, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x22, 0x15, 0x2f, 0x76, 0x31, + 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x5f, 0x62, 0x6f, + 0x64, 0x79, 0x12, 0xab, 0x01, 0x0a, 0x0a, 0x45, 0x63, 0x68, 0x6f, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x12, 0x3d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x70, 0x62, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x1a, 0x3d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, + 0x62, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, + 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x2a, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x12, 0xbd, 0x01, 0x0a, 0x09, 0x45, 0x63, 0x68, 0x6f, 0x50, 0x61, 0x74, 0x63, 0x68, 0x12, 0x44, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, + 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x1a, 0x44, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x1e, 0x3a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x32, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, + 0x12, 0xb7, 0x01, 0x0a, 0x10, 0x45, 0x63, 0x68, 0x6f, 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x3d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x1a, 0x3d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, + 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x5f, 0x75, 0x6e, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x42, 0x4d, 0x5a, 0x4b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, 0x63, + 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/examples/internal/proto/examplepb/echo_service.pb.gw.go b/examples/internal/proto/examplepb/echo_service.pb.gw.go index 0d237a3a913..5a5098787bf 100644 --- a/examples/internal/proto/examplepb/echo_service.pb.gw.go +++ b/examples/internal/proto/examplepb/echo_service.pb.gw.go @@ -32,7 +32,7 @@ var _ = utilities.NewDoubleArray var _ = metadata.Join var ( - filter_EchoService_Echo_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_EchoService_Echo_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_EchoService_Echo_0(ctx context.Context, marshaler runtime.Marshaler, client EchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -102,7 +102,7 @@ func local_request_EchoService_Echo_0(ctx context.Context, marshaler runtime.Mar } var ( - filter_EchoService_Echo_1 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "num": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} + filter_EchoService_Echo_1 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "num": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ) func request_EchoService_Echo_1(ctx context.Context, marshaler runtime.Marshaler, client EchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -192,7 +192,7 @@ func local_request_EchoService_Echo_1(ctx context.Context, marshaler runtime.Mar } var ( - filter_EchoService_Echo_2 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "num": 1, "lang": 2}, Base: []int{1, 2, 4, 6, 0, 0, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 2, 3, 3, 4, 4}} + filter_EchoService_Echo_2 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "num": 1, "lang": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} ) func request_EchoService_Echo_2(ctx context.Context, marshaler runtime.Marshaler, client EchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -312,7 +312,7 @@ func local_request_EchoService_Echo_2(ctx context.Context, marshaler runtime.Mar } var ( - filter_EchoService_Echo_3 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "line_num": 1, "lineNum": 2, "status": 3, "note": 4}, Base: []int{1, 2, 3, 4, 6, 7, 0, 0, 0, 0, 6, 0, 0}, Check: []int{0, 1, 1, 1, 1, 1, 2, 2, 3, 4, 5, 11, 6}} + filter_EchoService_Echo_3 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "line_num": 1, "status": 2, "note": 3}, Base: []int{1, 1, 2, 1, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 4, 2, 3, 5}} ) func request_EchoService_Echo_3(ctx context.Context, marshaler runtime.Marshaler, client EchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -432,7 +432,7 @@ func local_request_EchoService_Echo_3(ctx context.Context, marshaler runtime.Mar } var ( - filter_EchoService_Echo_4 = &utilities.DoubleArray{Encoding: map[string]int{"no": 0, "note": 1}, Base: []int{1, 2, 3, 2, 0, 0}, Check: []int{0, 1, 1, 2, 4, 3}} + filter_EchoService_Echo_4 = &utilities.DoubleArray{Encoding: map[string]int{"no": 0, "note": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} ) func request_EchoService_Echo_4(ctx context.Context, marshaler runtime.Marshaler, client EchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -501,76 +501,6 @@ func local_request_EchoService_Echo_4(ctx context.Context, marshaler runtime.Mar } -var ( - filter_EchoService_Echo_5 = &utilities.DoubleArray{Encoding: map[string]int{"resource_id": 0, "resourceId": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} -) - -func request_EchoService_Echo_5(ctx context.Context, marshaler runtime.Marshaler, client EchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SimpleMessage - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["resource_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource_id") - } - - protoReq.ResourceId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_EchoService_Echo_5); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Echo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_EchoService_Echo_5(ctx context.Context, marshaler runtime.Marshaler, server EchoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SimpleMessage - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["resource_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource_id") - } - - protoReq.ResourceId, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_EchoService_Echo_5); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Echo(ctx, &protoReq) - return msg, metadata, err - -} - func request_EchoService_EchoBody_0(ctx context.Context, marshaler runtime.Marshaler, client EchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq SimpleMessage var metadata runtime.ServerMetadata @@ -598,7 +528,7 @@ func local_request_EchoService_EchoBody_0(ctx context.Context, marshaler runtime } var ( - filter_EchoService_EchoBody_1 = &utilities.DoubleArray{Encoding: map[string]int{"no": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} + filter_EchoService_EchoBody_1 = &utilities.DoubleArray{Encoding: map[string]int{"no": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ) func request_EchoService_EchoBody_1(ctx context.Context, marshaler runtime.Marshaler, client EchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -685,84 +615,6 @@ func local_request_EchoService_EchoBody_1(ctx context.Context, marshaler runtime } -var ( - filter_EchoService_EchoBody_2 = &utilities.DoubleArray{Encoding: map[string]int{"resource_id": 0, "resourceId": 1, "id": 2}, Base: []int{1, 1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4, 4}} -) - -func request_EchoService_EchoBody_2(ctx context.Context, marshaler runtime.Marshaler, client EchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SimpleMessage - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.ResourceId); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_EchoService_EchoBody_2); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.EchoBody(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_EchoService_EchoBody_2(ctx context.Context, marshaler runtime.Marshaler, server EchoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SimpleMessage - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.ResourceId); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_EchoService_EchoBody_2); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.EchoBody(ctx, &protoReq) - return msg, metadata, err - -} - var ( filter_EchoService_EchoDelete_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -800,7 +652,7 @@ func local_request_EchoService_EchoDelete_0(ctx context.Context, marshaler runti } var ( - filter_EchoService_EchoPatch_0 = &utilities.DoubleArray{Encoding: map[string]int{"body": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_EchoService_EchoPatch_0 = &utilities.DoubleArray{Encoding: map[string]int{"body": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_EchoService_EchoPatch_0(ctx context.Context, marshaler runtime.Marshaler, client EchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -1032,31 +884,6 @@ func RegisterEchoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux }) - mux.Handle("GET", pattern_EchoService_Echo_5, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.EchoService/Echo", runtime.WithHTTPPathPattern("/v1/example/echo/resource/{resource_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_EchoService_Echo_5(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_EchoService_Echo_5(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("POST", pattern_EchoService_EchoBody_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1107,31 +934,6 @@ func RegisterEchoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux }) - mux.Handle("PUT", pattern_EchoService_EchoBody_2, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.EchoService/EchoBody", runtime.WithHTTPPathPattern("/v1/example/echo_body2/{id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_EchoService_EchoBody_2(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_EchoService_EchoBody_2(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("DELETE", pattern_EchoService_EchoDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1358,28 +1160,6 @@ func RegisterEchoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux }) - mux.Handle("GET", pattern_EchoService_Echo_5, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.EchoService/Echo", runtime.WithHTTPPathPattern("/v1/example/echo/resource/{resource_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_EchoService_Echo_5(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_EchoService_Echo_5(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("POST", pattern_EchoService_EchoBody_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1424,28 +1204,6 @@ func RegisterEchoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux }) - mux.Handle("PUT", pattern_EchoService_EchoBody_2, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.EchoService/EchoBody", runtime.WithHTTPPathPattern("/v1/example/echo_body2/{id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_EchoService_EchoBody_2(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_EchoService_EchoBody_2(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("DELETE", pattern_EchoService_EchoDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1526,14 +1284,10 @@ var ( pattern_EchoService_Echo_4 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "example", "echo2", "no.note"}, "")) - pattern_EchoService_Echo_5 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "example", "echo", "resource", "resource_id"}, "")) - pattern_EchoService_EchoBody_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "example", "echo_body"}, "")) pattern_EchoService_EchoBody_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "example", "echo_body", "id"}, "")) - pattern_EchoService_EchoBody_2 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "example", "echo_body2", "id"}, "")) - pattern_EchoService_EchoDelete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "example", "echo_delete"}, "")) pattern_EchoService_EchoPatch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "example", "echo_patch"}, "")) @@ -1552,14 +1306,10 @@ var ( forward_EchoService_Echo_4 = runtime.ForwardResponseMessage - forward_EchoService_Echo_5 = runtime.ForwardResponseMessage - forward_EchoService_EchoBody_0 = runtime.ForwardResponseMessage forward_EchoService_EchoBody_1 = runtime.ForwardResponseMessage - forward_EchoService_EchoBody_2 = runtime.ForwardResponseMessage - forward_EchoService_EchoDelete_0 = runtime.ForwardResponseMessage forward_EchoService_EchoPatch_0 = runtime.ForwardResponseMessage diff --git a/examples/internal/proto/examplepb/echo_service.proto b/examples/internal/proto/examplepb/echo_service.proto index 833d6b7faaf..bebeed41756 100644 --- a/examples/internal/proto/examplepb/echo_service.proto +++ b/examples/internal/proto/examplepb/echo_service.proto @@ -34,7 +34,6 @@ message SimpleMessage { int64 en = 6; Embedded no = 7; } - string resource_id = 8; } // DynamicMessage represents a message which can have its structure @@ -62,7 +61,6 @@ service EchoService { additional_bindings {get: "/v1/example/echo/{id}/{num}/{lang}"} additional_bindings {get: "/v1/example/echo1/{id}/{line_num}/{status.note}"} additional_bindings {get: "/v1/example/echo2/{no.note}"} - additional_bindings {get: "/v1/example/echo/resource/{resource_id}"} }; } // EchoBody method receives a simple message and returns it. @@ -74,10 +72,6 @@ service EchoService { put: "/v1/example/echo_body/{id}" body: "no" } - additional_bindings { - put: "/v1/example/echo_body2/{id}" - body: "resource_id" - } }; } // EchoDelete method receives a simple message and returns it. diff --git a/examples/internal/proto/examplepb/echo_service.swagger.json b/examples/internal/proto/examplepb/echo_service.swagger.json index 63ada7660f3..fa22d28b47d 100644 --- a/examples/internal/proto/examplepb/echo_service.swagger.json +++ b/examples/internal/proto/examplepb/echo_service.swagger.json @@ -17,98 +17,6 @@ "application/json" ], "paths": { - "/v1/example/echo/resource/{resourceId}": { - "get": { - "summary": "Echo method receives a simple message and returns it.", - "description": "The message posted as the id parameter will also be\nreturned.", - "operationId": "EchoService_Echo6", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/examplepbSimpleMessage" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "resourceId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "id", - "description": "Id represents the message identifier.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "num", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - }, - { - "name": "lineNum", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - }, - { - "name": "lang", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "status.progress", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - }, - { - "name": "status.note", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "en", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - }, - { - "name": "no.progress", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - }, - { - "name": "no.note", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "EchoService" - ] - } - }, "/v1/example/echo/{id}": { "post": { "summary": "Echo method receives a simple message and returns it.", @@ -188,12 +96,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "resourceId", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ @@ -280,12 +182,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "resourceId", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ @@ -372,12 +268,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "resourceId", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ @@ -458,12 +348,6 @@ "required": false, "type": "string", "format": "int64" - }, - { - "name": "resourceId", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ @@ -544,12 +428,6 @@ "required": false, "type": "string", "format": "int64" - }, - { - "name": "resourceId", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ @@ -664,105 +542,6 @@ "required": false, "type": "string", "format": "int64" - }, - { - "name": "resourceId", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "EchoService" - ] - } - }, - "/v1/example/echo_body2/{id}": { - "put": { - "summary": "EchoBody method receives a simple message and returns it.", - "operationId": "EchoService_EchoBody3", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/examplepbSimpleMessage" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "id", - "description": "Id represents the message identifier.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "resourceId", - "in": "body", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "num", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - }, - { - "name": "lineNum", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - }, - { - "name": "lang", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "status.progress", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - }, - { - "name": "status.note", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "en", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - }, - { - "name": "no.progress", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - }, - { - "name": "no.note", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ @@ -848,12 +627,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "resourceId", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ @@ -972,12 +745,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "resourceId", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ @@ -1048,9 +815,6 @@ }, "no": { "$ref": "#/definitions/examplepbEmbedded" - }, - "resourceId": { - "type": "string" } }, "description": "SimpleMessage represents a simple message sent to the Echo service." diff --git a/examples/internal/proto/examplepb/flow_combination.pb.gw.go b/examples/internal/proto/examplepb/flow_combination.pb.gw.go index a1726c7708c..1a0d9d5c0d0 100644 --- a/examples/internal/proto/examplepb/flow_combination.pb.gw.go +++ b/examples/internal/proto/examplepb/flow_combination.pb.gw.go @@ -388,7 +388,7 @@ func local_request_FlowCombination_RpcBodyRpc_3(ctx context.Context, marshaler r } var ( - filter_FlowCombination_RpcBodyRpc_4 = &utilities.DoubleArray{Encoding: map[string]int{"c": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_FlowCombination_RpcBodyRpc_4 = &utilities.DoubleArray{Encoding: map[string]int{"c": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_FlowCombination_RpcBodyRpc_4(ctx context.Context, marshaler runtime.Marshaler, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -432,7 +432,7 @@ func local_request_FlowCombination_RpcBodyRpc_4(ctx context.Context, marshaler r } var ( - filter_FlowCombination_RpcBodyRpc_5 = &utilities.DoubleArray{Encoding: map[string]int{"c": 0, "a": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} + filter_FlowCombination_RpcBodyRpc_5 = &utilities.DoubleArray{Encoding: map[string]int{"c": 0, "a": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ) func request_FlowCombination_RpcBodyRpc_5(ctx context.Context, marshaler runtime.Marshaler, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -510,7 +510,7 @@ func local_request_FlowCombination_RpcBodyRpc_5(ctx context.Context, marshaler r } var ( - filter_FlowCombination_RpcBodyRpc_6 = &utilities.DoubleArray{Encoding: map[string]int{"a": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_FlowCombination_RpcBodyRpc_6 = &utilities.DoubleArray{Encoding: map[string]int{"a": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_FlowCombination_RpcBodyRpc_6(ctx context.Context, marshaler runtime.Marshaler, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -580,7 +580,7 @@ func local_request_FlowCombination_RpcBodyRpc_6(ctx context.Context, marshaler r } var ( - filter_FlowCombination_RpcPathSingleNestedRpc_0 = &utilities.DoubleArray{Encoding: map[string]int{"a": 0, "str": 1}, Base: []int{1, 2, 3, 2, 0, 0}, Check: []int{0, 1, 1, 2, 4, 3}} + filter_FlowCombination_RpcPathSingleNestedRpc_0 = &utilities.DoubleArray{Encoding: map[string]int{"a": 0, "str": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} ) func request_FlowCombination_RpcPathSingleNestedRpc_0(ctx context.Context, marshaler runtime.Marshaler, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -650,7 +650,7 @@ func local_request_FlowCombination_RpcPathSingleNestedRpc_0(ctx context.Context, } var ( - filter_FlowCombination_RpcPathNestedRpc_0 = &utilities.DoubleArray{Encoding: map[string]int{"c": 0, "a": 1, "str": 2, "b": 3}, Base: []int{1, 2, 5, 5, 7, 0, 0, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 1, 2, 2, 3, 8, 4, 5, 5}} + filter_FlowCombination_RpcPathNestedRpc_0 = &utilities.DoubleArray{Encoding: map[string]int{"c": 0, "a": 1, "str": 2, "b": 3}, Base: []int{1, 1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 3, 1, 2, 4, 5}} ) func request_FlowCombination_RpcPathNestedRpc_0(ctx context.Context, marshaler runtime.Marshaler, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -748,7 +748,7 @@ func local_request_FlowCombination_RpcPathNestedRpc_0(ctx context.Context, marsh } var ( - filter_FlowCombination_RpcPathNestedRpc_1 = &utilities.DoubleArray{Encoding: map[string]int{"a": 0, "str": 1}, Base: []int{1, 2, 3, 2, 0, 0}, Check: []int{0, 1, 1, 2, 4, 3}} + filter_FlowCombination_RpcPathNestedRpc_1 = &utilities.DoubleArray{Encoding: map[string]int{"a": 0, "str": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} ) func request_FlowCombination_RpcPathNestedRpc_1(ctx context.Context, marshaler runtime.Marshaler, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -818,7 +818,7 @@ func local_request_FlowCombination_RpcPathNestedRpc_1(ctx context.Context, marsh } var ( - filter_FlowCombination_RpcPathNestedRpc_2 = &utilities.DoubleArray{Encoding: map[string]int{"c": 0, "a": 1, "str": 2}, Base: []int{1, 2, 4, 5, 0, 0, 4, 0, 0}, Check: []int{0, 1, 1, 1, 2, 2, 3, 7, 4}} + filter_FlowCombination_RpcPathNestedRpc_2 = &utilities.DoubleArray{Encoding: map[string]int{"c": 0, "a": 1, "str": 2}, Base: []int{1, 1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 3, 2, 4}} ) func request_FlowCombination_RpcPathNestedRpc_2(ctx context.Context, marshaler runtime.Marshaler, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -1047,7 +1047,7 @@ func request_FlowCombination_RpcBodyStream_3(ctx context.Context, marshaler runt } var ( - filter_FlowCombination_RpcBodyStream_4 = &utilities.DoubleArray{Encoding: map[string]int{"c": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_FlowCombination_RpcBodyStream_4 = &utilities.DoubleArray{Encoding: map[string]int{"c": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_FlowCombination_RpcBodyStream_4(ctx context.Context, marshaler runtime.Marshaler, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (FlowCombination_RpcBodyStreamClient, runtime.ServerMetadata, error) { @@ -1079,7 +1079,7 @@ func request_FlowCombination_RpcBodyStream_4(ctx context.Context, marshaler runt } var ( - filter_FlowCombination_RpcBodyStream_5 = &utilities.DoubleArray{Encoding: map[string]int{"c": 0, "a": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} + filter_FlowCombination_RpcBodyStream_5 = &utilities.DoubleArray{Encoding: map[string]int{"c": 0, "a": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ) func request_FlowCombination_RpcBodyStream_5(ctx context.Context, marshaler runtime.Marshaler, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (FlowCombination_RpcBodyStreamClient, runtime.ServerMetadata, error) { @@ -1128,7 +1128,7 @@ func request_FlowCombination_RpcBodyStream_5(ctx context.Context, marshaler runt } var ( - filter_FlowCombination_RpcBodyStream_6 = &utilities.DoubleArray{Encoding: map[string]int{"a": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_FlowCombination_RpcBodyStream_6 = &utilities.DoubleArray{Encoding: map[string]int{"a": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_FlowCombination_RpcBodyStream_6(ctx context.Context, marshaler runtime.Marshaler, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (FlowCombination_RpcBodyStreamClient, runtime.ServerMetadata, error) { @@ -1173,7 +1173,7 @@ func request_FlowCombination_RpcBodyStream_6(ctx context.Context, marshaler runt } var ( - filter_FlowCombination_RpcPathSingleNestedStream_0 = &utilities.DoubleArray{Encoding: map[string]int{"a": 0, "str": 1}, Base: []int{1, 2, 3, 2, 0, 0}, Check: []int{0, 1, 1, 2, 4, 3}} + filter_FlowCombination_RpcPathSingleNestedStream_0 = &utilities.DoubleArray{Encoding: map[string]int{"a": 0, "str": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} ) func request_FlowCombination_RpcPathSingleNestedStream_0(ctx context.Context, marshaler runtime.Marshaler, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (FlowCombination_RpcPathSingleNestedStreamClient, runtime.ServerMetadata, error) { @@ -1218,7 +1218,7 @@ func request_FlowCombination_RpcPathSingleNestedStream_0(ctx context.Context, ma } var ( - filter_FlowCombination_RpcPathNestedStream_0 = &utilities.DoubleArray{Encoding: map[string]int{"c": 0, "a": 1, "str": 2, "b": 3}, Base: []int{1, 2, 5, 5, 7, 0, 0, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 1, 2, 2, 3, 8, 4, 5, 5}} + filter_FlowCombination_RpcPathNestedStream_0 = &utilities.DoubleArray{Encoding: map[string]int{"c": 0, "a": 1, "str": 2, "b": 3}, Base: []int{1, 1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 3, 1, 2, 4, 5}} ) func request_FlowCombination_RpcPathNestedStream_0(ctx context.Context, marshaler runtime.Marshaler, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (FlowCombination_RpcPathNestedStreamClient, runtime.ServerMetadata, error) { @@ -1277,7 +1277,7 @@ func request_FlowCombination_RpcPathNestedStream_0(ctx context.Context, marshale } var ( - filter_FlowCombination_RpcPathNestedStream_1 = &utilities.DoubleArray{Encoding: map[string]int{"a": 0, "str": 1}, Base: []int{1, 2, 3, 2, 0, 0}, Check: []int{0, 1, 1, 2, 4, 3}} + filter_FlowCombination_RpcPathNestedStream_1 = &utilities.DoubleArray{Encoding: map[string]int{"a": 0, "str": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} ) func request_FlowCombination_RpcPathNestedStream_1(ctx context.Context, marshaler runtime.Marshaler, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (FlowCombination_RpcPathNestedStreamClient, runtime.ServerMetadata, error) { @@ -1322,7 +1322,7 @@ func request_FlowCombination_RpcPathNestedStream_1(ctx context.Context, marshale } var ( - filter_FlowCombination_RpcPathNestedStream_2 = &utilities.DoubleArray{Encoding: map[string]int{"c": 0, "a": 1, "str": 2}, Base: []int{1, 2, 4, 5, 0, 0, 4, 0, 0}, Check: []int{0, 1, 1, 1, 2, 2, 3, 7, 4}} + filter_FlowCombination_RpcPathNestedStream_2 = &utilities.DoubleArray{Encoding: map[string]int{"c": 0, "a": 1, "str": 2}, Base: []int{1, 1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 3, 2, 4}} ) func request_FlowCombination_RpcPathNestedStream_2(ctx context.Context, marshaler runtime.Marshaler, client FlowCombinationClient, req *http.Request, pathParams map[string]string) (FlowCombination_RpcPathNestedStreamClient, runtime.ServerMetadata, error) { diff --git a/examples/internal/proto/examplepb/non_standard_names.pb.gw.go b/examples/internal/proto/examplepb/non_standard_names.pb.gw.go index 378428e688a..d96960dd430 100644 --- a/examples/internal/proto/examplepb/non_standard_names.pb.gw.go +++ b/examples/internal/proto/examplepb/non_standard_names.pb.gw.go @@ -32,7 +32,7 @@ var _ = utilities.NewDoubleArray var _ = metadata.Join var ( - filter_NonStandardService_Update_0 = &utilities.DoubleArray{Encoding: map[string]int{"body": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_NonStandardService_Update_0 = &utilities.DoubleArray{Encoding: map[string]int{"body": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_NonStandardService_Update_0(ctx context.Context, marshaler runtime.Marshaler, client NonStandardServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -98,7 +98,7 @@ func local_request_NonStandardService_Update_0(ctx context.Context, marshaler ru } var ( - filter_NonStandardService_UpdateWithJSONNames_0 = &utilities.DoubleArray{Encoding: map[string]int{"body": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_NonStandardService_UpdateWithJSONNames_0 = &utilities.DoubleArray{Encoding: map[string]int{"body": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_NonStandardService_UpdateWithJSONNames_0(ctx context.Context, marshaler runtime.Marshaler, client NonStandardServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/examples/internal/proto/examplepb/unannotated_echo_service.pb.go b/examples/internal/proto/examplepb/unannotated_echo_service.pb.go index 37018940c90..5fd1ece25f6 100644 --- a/examples/internal/proto/examplepb/unannotated_echo_service.pb.go +++ b/examples/internal/proto/examplepb/unannotated_echo_service.pb.go @@ -131,8 +131,7 @@ type UnannotatedSimpleMessage struct { // // *UnannotatedSimpleMessage_En // *UnannotatedSimpleMessage_No - Ext isUnannotatedSimpleMessage_Ext `protobuf_oneof:"ext"` - ResourceId string `protobuf:"bytes,9,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` + Ext isUnannotatedSimpleMessage_Ext `protobuf_oneof:"ext"` } func (x *UnannotatedSimpleMessage) Reset() { @@ -237,13 +236,6 @@ func (x *UnannotatedSimpleMessage) GetNo() *UnannotatedEmbedded { return nil } -func (x *UnannotatedSimpleMessage) GetResourceId() string { - if x != nil { - return x.ResourceId - } - return "" -} - type isUnannotatedSimpleMessage_Code interface { isUnannotatedSimpleMessage_Code() } @@ -293,7 +285,7 @@ var file_examples_internal_proto_examplepb_unannotated_echo_service_proto_rawDes 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x04, 0x6e, 0x6f, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x6f, 0x74, 0x65, 0x42, 0x06, 0x0a, - 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0x9c, 0x03, 0x0a, 0x18, 0x55, 0x6e, 0x61, 0x6e, 0x6e, 0x6f, + 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0xfb, 0x02, 0x0a, 0x18, 0x55, 0x6e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, @@ -316,12 +308,20 @@ var file_examples_internal_proto_examplepb_unannotated_echo_service_proto_rawDes 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x48, 0x01, - 0x52, 0x02, 0x6e, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x49, 0x64, 0x42, 0x06, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x42, 0x05, 0x0a, - 0x03, 0x65, 0x78, 0x74, 0x32, 0xf9, 0x03, 0x0a, 0x16, 0x55, 0x6e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x65, 0x64, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x9a, 0x01, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x48, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x52, 0x02, 0x6e, 0x6f, 0x42, 0x06, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x42, 0x05, 0x0a, 0x03, + 0x65, 0x78, 0x74, 0x32, 0xf9, 0x03, 0x0a, 0x16, 0x55, 0x6e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x65, 0x64, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x9a, + 0x01, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x48, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x1a, 0x48, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, + 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x9e, 0x01, 0x0a, 0x08, + 0x45, 0x63, 0x68, 0x6f, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x48, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x61, 0x6e, 0x6e, 0x6f, @@ -330,34 +330,23 @@ var file_examples_internal_proto_examplepb_unannotated_echo_service_proto_rawDes 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x53, - 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x9e, 0x01, 0x0a, - 0x08, 0x45, 0x63, 0x68, 0x6f, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x48, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x1a, 0x48, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, - 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0xa0, 0x01, - 0x0a, 0x0a, 0x45, 0x63, 0x68, 0x6f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x48, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x55, 0x6e, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x48, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, - 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x65, 0x64, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x42, 0x57, 0x5a, 0x55, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, - 0x72, 0x70, 0x63, 0x2d, 0x65, 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x3b, - 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0xa0, 0x01, 0x0a, + 0x0a, 0x45, 0x63, 0x68, 0x6f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x48, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x48, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x65, 0x64, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, + 0x57, 0x5a, 0x55, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2d, 0x65, 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x3b, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/examples/internal/proto/examplepb/unannotated_echo_service.pb.gw.go b/examples/internal/proto/examplepb/unannotated_echo_service.pb.gw.go index ad6c4c1eb9b..6c268828283 100644 --- a/examples/internal/proto/examplepb/unannotated_echo_service.pb.gw.go +++ b/examples/internal/proto/examplepb/unannotated_echo_service.pb.gw.go @@ -32,7 +32,7 @@ var _ = utilities.NewDoubleArray var _ = metadata.Join var ( - filter_UnannotatedEchoService_Echo_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_UnannotatedEchoService_Echo_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_UnannotatedEchoService_Echo_0(ctx context.Context, marshaler runtime.Marshaler, client UnannotatedEchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -102,7 +102,7 @@ func local_request_UnannotatedEchoService_Echo_0(ctx context.Context, marshaler } var ( - filter_UnannotatedEchoService_Echo_1 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "num": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} + filter_UnannotatedEchoService_Echo_1 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "num": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ) func request_UnannotatedEchoService_Echo_1(ctx context.Context, marshaler runtime.Marshaler, client UnannotatedEchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/examples/internal/proto/examplepb/unannotated_echo_service.proto b/examples/internal/proto/examplepb/unannotated_echo_service.proto index b72aebc7284..fc8fbadb97d 100644 --- a/examples/internal/proto/examplepb/unannotated_echo_service.proto +++ b/examples/internal/proto/examplepb/unannotated_echo_service.proto @@ -37,7 +37,6 @@ message UnannotatedSimpleMessage { int64 en = 7; UnannotatedEmbedded no = 8; } - string resource_id = 9; } // Echo service responds to incoming echo requests. diff --git a/examples/internal/proto/examplepb/unannotated_echo_service.swagger.json b/examples/internal/proto/examplepb/unannotated_echo_service.swagger.json index a00abca478e..4ac0e7e57d2 100644 --- a/examples/internal/proto/examplepb/unannotated_echo_service.swagger.json +++ b/examples/internal/proto/examplepb/unannotated_echo_service.swagger.json @@ -156,12 +156,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "resourceId", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ @@ -281,12 +275,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "resourceId", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ @@ -440,12 +428,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "resourceId", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ @@ -503,9 +485,6 @@ }, "no": { "$ref": "#/definitions/examplepbUnannotatedEmbedded" - }, - "resourceId": { - "type": "string" } }, "description": "A simple message with many types", diff --git a/examples/internal/proto/examplepb/visibility_rule_echo_service.pb.gw.go b/examples/internal/proto/examplepb/visibility_rule_echo_service.pb.gw.go index 967693fa746..35e850f29f7 100644 --- a/examples/internal/proto/examplepb/visibility_rule_echo_service.pb.gw.go +++ b/examples/internal/proto/examplepb/visibility_rule_echo_service.pb.gw.go @@ -32,7 +32,7 @@ var _ = utilities.NewDoubleArray var _ = metadata.Join var ( - filter_VisibilityRuleEchoService_Echo_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_VisibilityRuleEchoService_Echo_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_VisibilityRuleEchoService_Echo_0(ctx context.Context, marshaler runtime.Marshaler, client VisibilityRuleEchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -210,7 +210,7 @@ func local_request_VisibilityRuleEchoService_EchoInternalAndPreview_0(ctx contex } var ( - filter_VisibilityRuleInternalEchoService_Echo_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_VisibilityRuleInternalEchoService_Echo_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_VisibilityRuleInternalEchoService_Echo_0(ctx context.Context, marshaler runtime.Marshaler, client VisibilityRuleInternalEchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/examples/internal/proto/standalone/unannotated_echo_service.pb.gw.go b/examples/internal/proto/standalone/unannotated_echo_service.pb.gw.go index ce47284442d..44fe70a9988 100644 --- a/examples/internal/proto/standalone/unannotated_echo_service.pb.gw.go +++ b/examples/internal/proto/standalone/unannotated_echo_service.pb.gw.go @@ -33,7 +33,7 @@ var _ = utilities.NewDoubleArray var _ = metadata.Join var ( - filter_UnannotatedEchoService_Echo_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_UnannotatedEchoService_Echo_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_UnannotatedEchoService_Echo_0(ctx context.Context, marshaler runtime.Marshaler, client extExamplepb.UnannotatedEchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -103,7 +103,7 @@ func local_request_UnannotatedEchoService_Echo_0(ctx context.Context, marshaler } var ( - filter_UnannotatedEchoService_Echo_1 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "num": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} + filter_UnannotatedEchoService_Echo_1 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "num": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ) func request_UnannotatedEchoService_Echo_1(ctx context.Context, marshaler runtime.Marshaler, client extExamplepb.UnannotatedEchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -193,7 +193,7 @@ func local_request_UnannotatedEchoService_Echo_1(ctx context.Context, marshaler } var ( - filter_UnannotatedEchoService_Echo_2 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "num": 1, "lang": 2}, Base: []int{1, 2, 4, 6, 0, 0, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 2, 3, 3, 4, 4}} + filter_UnannotatedEchoService_Echo_2 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "num": 1, "lang": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} ) func request_UnannotatedEchoService_Echo_2(ctx context.Context, marshaler runtime.Marshaler, client extExamplepb.UnannotatedEchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -313,7 +313,7 @@ func local_request_UnannotatedEchoService_Echo_2(ctx context.Context, marshaler } var ( - filter_UnannotatedEchoService_Echo_3 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "line_num": 1, "lineNum": 2, "status": 3, "note": 4}, Base: []int{1, 2, 3, 4, 6, 7, 0, 0, 0, 0, 6, 0, 0}, Check: []int{0, 1, 1, 1, 1, 1, 2, 2, 3, 4, 5, 11, 6}} + filter_UnannotatedEchoService_Echo_3 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "line_num": 1, "status": 2, "note": 3}, Base: []int{1, 1, 2, 1, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 4, 2, 3, 5}} ) func request_UnannotatedEchoService_Echo_3(ctx context.Context, marshaler runtime.Marshaler, client extExamplepb.UnannotatedEchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -433,7 +433,7 @@ func local_request_UnannotatedEchoService_Echo_3(ctx context.Context, marshaler } var ( - filter_UnannotatedEchoService_Echo_4 = &utilities.DoubleArray{Encoding: map[string]int{"no": 0, "note": 1}, Base: []int{1, 2, 3, 2, 0, 0}, Check: []int{0, 1, 1, 2, 4, 3}} + filter_UnannotatedEchoService_Echo_4 = &utilities.DoubleArray{Encoding: map[string]int{"no": 0, "note": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} ) func request_UnannotatedEchoService_Echo_4(ctx context.Context, marshaler runtime.Marshaler, client extExamplepb.UnannotatedEchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/protoc-gen-grpc-gateway/internal/gengateway/template.go b/protoc-gen-grpc-gateway/internal/gengateway/template.go index 0d1acc942c0..09bd35b7f1e 100644 --- a/protoc-gen-grpc-gateway/internal/gengateway/template.go +++ b/protoc-gen-grpc-gateway/internal/gengateway/template.go @@ -69,17 +69,9 @@ func (b binding) QueryParamFilter() queryParamFilter { var seqs [][]string if b.Body != nil { seqs = append(seqs, strings.Split(b.Body.FieldPath.String(), ".")) - for _, comp := range b.Body.FieldPath { - if comp.Target.JsonName != nil { - seqs = append(seqs, strings.Split(*comp.Target.JsonName, ".")) - } - } } for _, p := range b.PathParams { seqs = append(seqs, strings.Split(p.FieldPath.String(), ".")) - if p.Target.JsonName != nil { - seqs = append(seqs, strings.Split(*p.Target.JsonName, ".")) - } } return queryParamFilter{utilities.NewDoubleArray(seqs)} }