Skip to content

Conversation

@ePaul
Copy link
Contributor

@ePaul ePaul commented Mar 15, 2017

PR checklist

  • Read the contribution guidelines.
  • Ran the shell/batch script under ./bin/ to update Petstore sample so that CIs can verify the change.
    → all of bin/*.sh (if executable).
  • Filed the PR against the correct branch: 2.3.0 branch for breaking (non-backward compatible) changes.

Description of the PR

@wing328 in #5072 merged the state of master at february 8 into branch 2.3.0.
This follows up with a current master (today).

wing328 and others added 30 commits February 11, 2017 22:47
…api#4695)

If the swagger model contains a class named 'Object' some mustache templates
will generate non compiling **Java** code.
…to boolean. (swagger-api#4747)

CodegenOperation and CodegenProperty classes have boolean fields instead of Boolean.
This fix changes Boolean fields of CodegenParameter and CodegenResponse to boolean as well.

Boolean fields are not necessary. Other classes interacting with them have to check for null
before interacting with them which is unnecessary and leads to ugly code.
* add boolean datatype flags to CodegenResponse and logic to set them in DefaultCodegen

* use Boolean.TRUE.equals to check for isResponseBinary or isResponseFile
While creating a static library from the generated files, compilation issues arose due to QDateTime only being forward declared. Adding the include resolves the issue.
…-api#4712)

* add language for resteasy eap swagger-api#4512

* first implementation of jaxrs-resteasy-eap swagger-api#4512

* add support for joda and java8 datetime types swagger-api#4512

* add new file JacksonConfig and new sample eap-joda swagger-api#4512

* add dynamic swagger support to jaxrs-resteasy-eap swagger-api#4512

* adapt readme for eap swagger-api#4512

* add tests for jaxrs-resteasy-eap swagger-api#4512

* cleanup tabs swagger-api#4512

* cleanup tabs swagger-api#4512

* cleanup tabs swagger-api#4512

* cleanup tabs / regenerate without joda swagger-api#4512

* regenerate with updated templates swagger-api#4512

* fix test (wrong setter invoked) swagger-api#4512

* fix test swagger-api#4512

* fix no invocation swagger-api#4512

* replace tabs with spaces swagger-api#4512
@wing328 wing328 added this to the v2.3.0 milestone Mar 15, 2017
@wing328
Copy link
Contributor

wing328 commented Mar 15, 2017

@ePaul thanks for the PR but Travis CI failed with the following error message:

[ERROR]     Child module /home/travis/build/swagger-api/swagger-codegen/samples/server/petstore/springboot/pom.xml of /home/travis/build/swagger-api/swagger-codegen/pom.xml does not exist

Did you run ./bin/run-all-petstore to update all Petstore samples?

@ePaul
Copy link
Contributor Author

ePaul commented Mar 15, 2017

I used for d in bin/*.sh ; do $d ; done in my bash. I was not aware of run-all-petstore, will use this in the future.

The springboot/pom.xml is missing due to #5063 – I though #5064 was already merged, but it wasn't. Will fix this right now.

@ePaul ePaul force-pushed the new-sync-master-to-2.3.0 branch from 078f632 to 5bb0f7a Compare March 15, 2017 17:26
…#5064)

* Update samples for springboot, spring-delegate, spring-delegate-j8.

* Issue swagger-api#5063: delete samples in the correct directory.
@wing328
Copy link
Contributor

wing328 commented Mar 15, 2017

Just merged #5064.

@ePaul
Copy link
Contributor Author

ePaul commented Mar 15, 2017

Now Java7 build fails with the tests of Go Petstore client:

=== RUN TestDeletePet
--- PASS: TestDeletePet (0.00s)
=== RUN TestConcurrency
--- FAIL: TestConcurrency (1.02s)
	Error Trace:	pet_api_test.go:193
			pet_api_test.go:165
	Error:      	Not equal: 
	            	expected: 0
	            	received: 12348
	Messages:   	Pet id should be equal
	Error Trace:	pet_api_test.go:194
			pet_api_test.go:165
	Error:      	Not equal: 
	            	expected: ""
	            	received: "gopherJohn"
	Messages:   	Pet name should be gopherJohn
	Error Trace:	pet_api_test.go:195
			pet_api_test.go:165
	Error:      	Not equal: 
	            	expected: ""
	            	received: "dead"
	Messages:   	Pet status should be dead
	pet_api_test.go:200: &{404 Not Found 404 HTTP/1.1 1 1 map[Server:[Jetty(9.2.9.v20150224)] Date:[Wed, 15 Mar 2017 17:31:27 GMT] Access-Control-Allow-Origin:[*] Access-Control-Allow-Methods:[GET, POST, DELETE, PUT] Access-Control-Allow-Headers:[Content-Type, api_key, Authorization] Content-Type:[application/json]] 0xc208128440 -1 [chunked] false map[] 0xc20801f520 <nil>}
	pet_api_test.go:182: &{404 Not Found 404 HTTP/1.1 1 1 map[Access-Control-Allow-Origin:[*] Access-Control-Allow-Methods:[GET, POST, DELETE, PUT] Access-Control-Allow-Headers:[Content-Type, api_key, Authorization] Content-Length:[0] Server:[Jetty(9.2.9.v20150224)] Date:[Wed, 15 Mar 2017 17:31:27 GMT]] 0xc208128a00 0 [] false map[] 0xc20801ec30 <nil>}
=== RUN TestCreateUser
--- PASS: TestCreateUser (0.00s)

(It looks like expected and received are swapped here?)

Java 8 build passes those, but then fails with okhttp-gson:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/travis/build/swagger-api/swagger-codegen/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java:[79,15] error: constructor JSON in class JSON cannot be applied to given types;
[ERROR]   required: no arguments
  found: ApiClient
  reason: actual and formal argument lists differ in length
/home/travis/build/swagger-api/swagger-codegen/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java:[85,12] error: cannot find symbol
[ERROR]   symbol: variable dateFormat
/home/travis/build/swagger-api/swagger-codegen/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java:[85,30] error: cannot find symbol
[ERROR]   symbol:   class SimpleDateFormat
  location: class ApiClient
/home/travis/build/swagger-api/swagger-codegen/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java:[87,12] error: cannot find symbol
[ERROR]   symbol: variable dateFormat
/home/travis/build/swagger-api/swagger-codegen/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java:[88,8] error: cannot find symbol
[INFO] 5 errors 
[INFO] -------------------------------------------------------------

I'll try to have a look at the details later.

(Go client failure was likely sporadic, not reproducible. The okhttp-gson one was a broken merge.)

@ePaul ePaul mentioned this pull request Mar 15, 2017
3 tasks
@ePaul
Copy link
Contributor Author

ePaul commented Mar 16, 2017

Next step: scala-client.

[INFO] --- scala-maven-plugin:3.1.5:compile (scala-compile-first) @ swagger-scala-client ---
[INFO] /home/travis/build/swagger-api/swagger-codegen/samples/client/petstore/scala/src/main/scala:-1: info: compiling
[INFO] Compiling 10 source files to /home/travis/build/swagger-api/swagger-codegen/samples/client/petstore/scala/target/classes at 1489672768547
[ERROR] /home/travis/build/swagger-api/swagger-codegen/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala:34: error: object datatype is not a member of package com.fasterxml.jackson
[ERROR] import com.fasterxml.jackson.datatype.joda.JodaModule
[ERROR]                              ^
[ERROR] /home/travis/build/swagger-api/swagger-codegen/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala:44: error: not found: type JodaModule
[ERROR]     mapper.registerModule(new JodaModule());
[ERROR]                               ^
[ERROR] two errors found

@ePaul
Copy link
Contributor Author

ePaul commented Mar 16, 2017

Hmm, in master scala-client has jackson-datatype-joda as an indirect dependency due to swagger-core 1.5.9. Same in branch 2.3.0. But in this branch we somehow have swagger-code 1.5.12, which doesn't depend on jackson-datatype-joda anymore.

Turns out the template in master also has 1.5.2, changed in #4881, but the samples were not updated yet.
I'll open a separate PR #5092 to update this in master (and potentially also fix it).

@ePaul
Copy link
Contributor Author

ePaul commented Mar 16, 2017

Shippable doesn't run here?

@wing328
Copy link
Contributor

wing328 commented Mar 16, 2017

@ePaul I've seen similar issue in which some CI tests are not shown/triggered. It could be an issue with the CI provider.

@wing328 wing328 merged commit d2adccb into swagger-api:2.3.0 Mar 17, 2017
@wing328
Copy link
Contributor

wing328 commented Mar 17, 2017

@ePaul thanks for the effort. Moving forward, I'll try to sync master to 2.3.0 every day to minimize the effort in resolving the merge conflicts during the sync.

@ePaul ePaul deleted the new-sync-master-to-2.3.0 branch March 17, 2017 13:11
@wing328 wing328 changed the title New sync master to 2.3.0 Sync enhancements/bug fixes in master to 2.3.0 May 17, 2017
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.