Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Swagger Codegen from 2.1.6 to 2.2.2 #415

Merged
merged 3 commits into from
Jun 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ cache:
- ${TRAVIS_BUILD_DIR}/examples/browser/node_modules
before_install:
- ./.travis/install-protoc.sh 3.1.0
- ./.travis/install-swagger-codegen.sh 2.1.6
- ./.travis/install-swagger-codegen.sh 2.2.2
- nvm install v6.1 && nvm use v6.1 && node --version
- go get github.com/golang/lint/golint
- go get github.com/dghubble/sling
- go get github.com/go-resty/resty
install:
- go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
- go get github.com/grpc-ecosystem/grpc-gateway/runtime
Expand Down
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,16 @@ $(EXAMPLE_SWAGGERSRCS): $(SWAGGER_PLUGIN) $(SWAGGER_EXAMPLES)

$(ECHO_EXAMPLE_SRCS): $(ECHO_EXAMPLE_SPEC)
$(SWAGGER_CODEGEN) generate -i $(ECHO_EXAMPLE_SPEC) \
-l go -o examples/clients --additional-properties packageName=echo
@rm -f $(EXAMPLE_CLIENT_DIR)/README.md $(EXAMPLE_CLIENT_DIR)/git_push.sh $(EXAMPLE_CLIENT_DIR)/.gitignore
-l go -o examples/clients/echo --additional-properties packageName=echo
@rm -f $(EXAMPLE_CLIENT_DIR)/echo/README.md \
$(EXAMPLE_CLIENT_DIR)/echo/git_push.sh \
$(EXAMPLE_CLIENT_DIR)/echo/.travis.yml
$(ABE_EXAMPLE_SRCS): $(ABE_EXAMPLE_SPEC)
$(SWAGGER_CODEGEN) generate -i $(ABE_EXAMPLE_SPEC) \
-l go -o examples/clients --additional-properties packageName=abe
@rm -f $(EXAMPLE_CLIENT_DIR)/README.md $(EXAMPLE_CLIENT_DIR)/git_push.sh $(EXAMPLE_CLIENT_DIR)/.gitignore
-l go -o examples/clients/abe --additional-properties packageName=abe
@rm -f $(EXAMPLE_CLIENT_DIR)/abe/README.md \
$(EXAMPLE_CLIENT_DIR)/abe/git_push.sh \
$(EXAMPLE_CLIENT_DIR)/abe/.travis.yml

examples: $(EXAMPLE_SVCSRCS) $(EXAMPLE_GWSRCS) $(EXAMPLE_DEPSRCS) $(EXAMPLE_SWAGGERSRCS) $(EXAMPLE_CLIENT_SRCS)
test: examples
Expand Down
10 changes: 5 additions & 5 deletions examples/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestEchoClient(t *testing.T) {
}

cl := echo.NewEchoServiceApiWithBasePath("http://localhost:8080")
resp, err := cl.Echo("foo")
resp, _, err := cl.Echo("foo")
if err != nil {
t.Errorf(`cl.Echo("foo") failed with %v; want success`, err)
}
Expand All @@ -35,7 +35,7 @@ func TestEchoBodyClient(t *testing.T) {

cl := echo.NewEchoServiceApiWithBasePath("http://localhost:8080")
req := echo.ExamplepbSimpleMessage{Id: "foo"}
resp, err := cl.EchoBody(req)
resp, _, err := cl.EchoBody(req)
if err != nil {
t.Errorf("cl.EchoBody(%#v) failed with %v; want success", req, err)
}
Expand All @@ -56,7 +56,7 @@ func TestAbitOfEverythingClient(t *testing.T) {
}

func testABEClientCreate(t *testing.T, cl *abe.ABitOfEverythingServiceApi) {
want := abe.ExamplepbABitOfEverything{
want := &abe.ExamplepbABitOfEverything{
FloatValue: 1.5,
DoubleValue: 2.5,
Int64Value: "4294967296",
Expand All @@ -73,7 +73,7 @@ func testABEClientCreate(t *testing.T, cl *abe.ABitOfEverythingServiceApi) {
Sint64Value: "4611686018427387903",
NonConventionalNameValue: "camelCase",
}
resp, err := cl.Create(
resp, _, err := cl.Create(
want.FloatValue,
want.DoubleValue,
want.Int64Value,
Expand Down Expand Up @@ -148,7 +148,7 @@ func testABEClientCreateBody(t *testing.T, cl *abe.ABitOfEverythingServiceApi) {
"b": {Name: "y", Amount: 2},
},
}
resp, err := cl.CreateBody(want)
resp, _, err := cl.CreateBody(want)
if err != nil {
t.Errorf("cl.CreateBody(%#v) failed with %v; want success", want, err)
}
Expand Down
1 change: 1 addition & 0 deletions examples/clients/abe/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/docs
1 change: 1 addition & 0 deletions examples/clients/abe/.swagger-codegen-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.gitignore
11 changes: 0 additions & 11 deletions examples/clients/abe/ABitOfEverythingNested.go

This file was deleted.

Loading