Skip to content

Commit

Permalink
WiP: Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zoido committed Nov 15, 2020
1 parent 3947774 commit 3d984a8
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 55 deletions.
16 changes: 5 additions & 11 deletions examples/internal/clients/abe/api/swagger.yaml
Expand Up @@ -1864,11 +1864,9 @@ paths:
in: "query"
description: "The paths to update."
required: false
type: "array"
items:
type: "string"
collectionFormat: "multi"
type: "string"
x-exportParamName: "UpdateMask"
x-optionalDataType: "String"
responses:
200:
description: "A successful response."
Expand Down Expand Up @@ -1910,11 +1908,9 @@ paths:
in: "query"
description: "The paths to update."
required: false
type: "array"
items:
type: "string"
collectionFormat: "multi"
type: "string"
x-exportParamName: "UpdateMask"
x-optionalDataType: "String"
responses:
200:
description: "A successful response."
Expand Down Expand Up @@ -2620,10 +2616,8 @@ definitions:
abe:
$ref: "#/definitions/examplepbABitOfEverything"
updateMask:
type: "array"
type: "string"
description: "The paths to update."
items:
type: "string"
title: "UpdateV2Request request for update includes the message and the update\
\ mask"
pathenumPathEnum:
Expand Down
12 changes: 6 additions & 6 deletions examples/internal/clients/abe/api_a_bit_of_everything_service.go
Expand Up @@ -3554,13 +3554,13 @@ ABitOfEverythingServiceApiService
* @param abeUuid
* @param body
* @param optional nil or *ABitOfEverythingServiceUpdateV2Opts - Optional Parameters:
* @param "UpdateMask" (optional.Interface of []string) - The paths to update.
* @param "UpdateMask" (optional.String) - The paths to update.
@return interface{}
*/

type ABitOfEverythingServiceUpdateV2Opts struct {
UpdateMask optional.Interface
UpdateMask optional.String
}

func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateV2(ctx context.Context, abeUuid string, body ExamplepbABitOfEverything, localVarOptionals *ABitOfEverythingServiceUpdateV2Opts) (interface{}, *http.Response, error) {
Expand All @@ -3581,7 +3581,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateV2(ctx
localVarFormParams := url.Values{}

if localVarOptionals != nil && localVarOptionals.UpdateMask.IsSet() {
localVarQueryParams.Add("updateMask", parameterToString(localVarOptionals.UpdateMask.Value(), "multi"))
localVarQueryParams.Add("updateMask", parameterToString(localVarOptionals.UpdateMask.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"}
Expand Down Expand Up @@ -3712,13 +3712,13 @@ ABitOfEverythingServiceApiService
* @param abeUuid
* @param body
* @param optional nil or *ABitOfEverythingServiceUpdateV22Opts - Optional Parameters:
* @param "UpdateMask" (optional.Interface of []string) - The paths to update.
* @param "UpdateMask" (optional.String) - The paths to update.
@return interface{}
*/

type ABitOfEverythingServiceUpdateV22Opts struct {
UpdateMask optional.Interface
UpdateMask optional.String
}

func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateV22(ctx context.Context, abeUuid string, body ExamplepbABitOfEverything, localVarOptionals *ABitOfEverythingServiceUpdateV22Opts) (interface{}, *http.Response, error) {
Expand All @@ -3739,7 +3739,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateV22(ctx
localVarFormParams := url.Values{}

if localVarOptionals != nil && localVarOptionals.UpdateMask.IsSet() {
localVarQueryParams.Add("updateMask", parameterToString(localVarOptionals.UpdateMask.Value(), "multi"))
localVarQueryParams.Add("updateMask", parameterToString(localVarOptionals.UpdateMask.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"}
Expand Down
Expand Up @@ -13,5 +13,5 @@ package abe
type ExamplepbUpdateV2Request struct {
Abe *ExamplepbABitOfEverything `json:"abe,omitempty"`
// The paths to update.
UpdateMask []string `json:"updateMask,omitempty"`
UpdateMask string `json:"updateMask,omitempty"`
}
14 changes: 4 additions & 10 deletions examples/internal/clients/echo/api/swagger.yaml
Expand Up @@ -433,11 +433,9 @@ paths:
- name: "updateMask"
in: "query"
required: false
type: "array"
items:
type: "string"
collectionFormat: "multi"
type: "string"
x-exportParamName: "UpdateMask"
x-optionalDataType: "String"
responses:
200:
description: "A successful response."
Expand Down Expand Up @@ -468,16 +466,12 @@ definitions:
body:
$ref: "#/definitions/examplepbDynamicMessage"
updateMask:
type: "array"
items:
type: "string"
type: "string"
example:
body:
structField: "{}"
valueField: "{}"
updateMask:
- "updateMask"
- "updateMask"
updateMask: "updateMask"
examplepbEmbedded:
type: "object"
properties:
Expand Down
6 changes: 3 additions & 3 deletions examples/internal/clients/echo/api_echo_service.go
Expand Up @@ -933,13 +933,13 @@ EchoServiceApiService EchoPatch method receives a NonStandardUpdateRequest and r
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param body
* @param optional nil or *EchoServiceEchoPatchOpts - Optional Parameters:
* @param "UpdateMask" (optional.Interface of []string) -
* @param "UpdateMask" (optional.String) -
@return ExamplepbDynamicMessageUpdate
*/

type EchoServiceEchoPatchOpts struct {
UpdateMask optional.Interface
UpdateMask optional.String
}

func (a *EchoServiceApiService) EchoServiceEchoPatch(ctx context.Context, body ExamplepbDynamicMessage, localVarOptionals *EchoServiceEchoPatchOpts) (ExamplepbDynamicMessageUpdate, *http.Response, error) {
Expand All @@ -959,7 +959,7 @@ func (a *EchoServiceApiService) EchoServiceEchoPatch(ctx context.Context, body E
localVarFormParams := url.Values{}

if localVarOptionals != nil && localVarOptionals.UpdateMask.IsSet() {
localVarQueryParams.Add("updateMask", parameterToString(localVarOptionals.UpdateMask.Value(), "multi"))
localVarQueryParams.Add("updateMask", parameterToString(localVarOptionals.UpdateMask.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
Expand Down
Expand Up @@ -11,5 +11,5 @@ package echo

type ExamplepbDynamicMessageUpdate struct {
Body *ExamplepbDynamicMessage `json:"body,omitempty"`
UpdateMask []string `json:"updateMask,omitempty"`
UpdateMask string `json:"updateMask,omitempty"`
}
17 changes: 3 additions & 14 deletions examples/internal/proto/examplepb/a_bit_of_everything.swagger.json
Expand Up @@ -2208,11 +2208,7 @@
"description": "The paths to update.",
"in": "query",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "multi"
"type": "string"
}
],
"tags": [
Expand Down Expand Up @@ -2272,11 +2268,7 @@
"description": "The paths to update.",
"in": "query",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "multi"
"type": "string"
}
],
"tags": [
Expand Down Expand Up @@ -3194,10 +3186,7 @@
"$ref": "#/definitions/examplepbABitOfEverything"
},
"updateMask": {
"type": "array",
"items": {
"type": "string"
},
"type": "string",
"description": "The paths to update."
}
},
Expand Down
11 changes: 2 additions & 9 deletions examples/internal/proto/examplepb/echo_service.swagger.json
Expand Up @@ -526,11 +526,7 @@
"name": "updateMask",
"in": "query",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "multi"
"type": "string"
}
],
"tags": [
Expand Down Expand Up @@ -559,10 +555,7 @@
"$ref": "#/definitions/examplepbDynamicMessage"
},
"updateMask": {
"type": "array",
"items": {
"type": "string"
}
"type": "string"
}
}
},
Expand Down

0 comments on commit 3d984a8

Please sign in to comment.