Skip to content

[Go] fix issues with required object parameters marked omitempty#4682

Merged
wing328 merged 2 commits intoswagger-api:masterfrom
vvalchev:issue_4665
Feb 1, 2017
Merged

[Go] fix issues with required object parameters marked omitempty#4682
wing328 merged 2 commits intoswagger-api:masterfrom
vvalchev:issue_4665

Conversation

@vvalchev
Copy link
Copy Markdown
Contributor

Description of the PR

Details are included in the issue.

I tried to create a test, but it would take inadequate amount of time to understand how codegen works internally and how to deal with mustache. Sorry.

@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Jan 31, 2017

@vvalchev thanks for the PR and thinking about adding a test case.

I would suggest creating a file "pet_test.go" similar to https://github.com/swagger-api/swagger-codegen/blob/master/samples/client/petstore/go/pet_api_test.go to test the Pet model. Let me know if you need any help.

@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Jan 31, 2017

@vvalchev also, please run ./bin/go-petstore.sh to update the Petstore sample for Go API client so that the CIs can verify the change.

@wing328 wing328 added this to the v2.2.2 milestone Jan 31, 2017
Please note, that there are quite few changes, that doesn’t come from the diff I’ve applied. Seems the script wasn’t run on the previous commit.
@vvalchev
Copy link
Copy Markdown
Contributor Author

vvalchev commented Feb 1, 2017

I've run the script and committed the changed files. But few of the changes are not because of the diff, I've applied. Still I was able to compile the generated client successfully.

Sorry for the test, probably somebody else can contribute one.

@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Feb 1, 2017

Sorry for the test, probably somebody else can contribute one.

@vvalchev No problem at all.

@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Feb 1, 2017

@vvalchev the change looks good. Thanks for your contribution.

@wing328 wing328 merged commit 96ed41a into swagger-api:master Feb 1, 2017
@wing328 wing328 changed the title Fixed issue #4665 [go] required object parameters are marked omitempty. [Go] fix issues with required object parameters marked omitempty Feb 20, 2017
davidgri pushed a commit to davidgri/swagger-codegen that referenced this pull request May 11, 2017
…ed omitempty. (swagger-api#4682)

* Fixed issue swagger-api#4665 [go] required object parameters are marked omitempty.

* Run ./bin/go-petstore.sh as suggested by @wing328.
Please note, that there are quite few changes, that doesn’t come from the diff I’ve applied. Seems the script wasn’t run on the previous commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants