Commit Graph

9973 Commits

Author SHA1 Message Date
wing328
15b3dfbb80 update java petstore samples 2018-01-26 10:02:24 +08:00
Benjamin Roedell
47111b3241 Issue 4824 fix gson deserialize format byte (#7473)
* Build sample prior to code changes so differences are easier to decipher

* Add byte array type adapter for okhttp-gson (java8 only)

* Unit revealed that Gson (or GsonFire) defaults to escape = (equal sign) out of base64 string.  Add disableHtmlEscaping() to gsonbuilder.

* Update specs and samples to include format=byte and include junit test of byte array serialization and deserialization.

* Implement recommendations by @cbornet including: Use okio.ByteString for base64 conversions instead of java 8 lib since the okhttp-gson client already includes okio. Remove setting to disableHtmlEscaping. Rename LocalByteArrayAdapter to ByteArrayAdapter.

* Update spec and sample for java okhttp-gson library client

* Undo addition of profilePhoto property.  A format byte property is already available under the format_test definition.

* Put previously deleted tests back. Modified testFindPetsByTags() to verify exception since the server now returns a 500 for this request.

* Update test to pass when run against docker containerized server swaggerapi/petstore (heads up, this test fails if calling out to the internet published version of http://petstore.swagger.io)
2018-01-26 09:52:49 +08:00
William Cheng
2d898511a8
Add Play server samples to CircleCI (#7501)
* add play server samples to circle ci

* add pom.xml for java play framework
2018-01-26 09:48:51 +08:00
Jens Radtke
76907cacde fix: declare property headerSelector (#7495)
The property was created dynamically, it's a more clean approach to
declare it as a member of the class.
2018-01-26 00:49:35 +08:00
William Cheng
2394fac677
update swagger annoatation version to 1.5.17 (#7500) 2018-01-25 23:29:20 +08:00
William Cheng
df10c725ab
Add lua test script, minor fix to Lua API files (#7490)
* add lua test script, minor fix to api files

* fix model import, avoid null header issue

* add space before equal sign
2018-01-25 22:01:04 +08:00
Jean-François Côté
e33b350c89 Fix an issue in Play Framework generator where a CSV is empty and transfered to the controllerImp with an empty item. (#7496) 2018-01-25 21:53:20 +08:00
etondoze
d1a296412e Upgraded swagger-parser and swagger-core versions (#7497) 2018-01-25 21:35:11 +08:00
ehyche
a3d0f1d4bd Swift4: make generated models structs instead of classes (#7345)
* Split up model template into partials

* Change models from class to struct.

This fixes issue https://github.com/swagger-api/swagger-codegen/issues/6941.

In this change, we make our Swift4 generated model objects struct instead of class. However, in order to do this, we needed to handle the following edge cases:

* Inheritance and polymorphism (allOf)
  * With classes, we use inheritance. So therefore, the parent properties are ONLY on the parent generated class, and the model object which derives from the parent class picks up those properties through inheritance.
  * However, structs do not support inheritance. So we simply duplicate the parent allOf properties in the child struct.
* We have to handle the case where the property name on the struct may be different than the property name in the JSON. By default, the Codable protocol assumes that the JSON property name is the same as the struct property name. If they need to be different, then we generate a CodingKeys string enum, which contains the mapping between struct property name and JSON property name.
* additionalProperties. We cannot use the default Codable implementation for the additionalProperties, since it will look for an actual dictionary called "additionalProperties" in the JSON. Therefore, for model objects which have additionalProperties, we must generate our own implementation for the Decodable and Encodable protocols.

I have run ./bin/swift4-all.sh and ./bin/swift4-test.sh to re-generate all of the sources, and I have verified that the generated code in samples/clients/test/swift4/default builds and the unit tests pass.

* Update VERSION in .swagger-codegen

* Update generated code for swift4-test schema
2018-01-25 21:33:11 +08:00
Jeffrey Slort
2b84118c9f removed isomorphic-fetch typing dependency (#6894)
* removed isomorphic-fetch typing dependency
removed postinstall command

* space

* regenerated samples

* updated security samples

* fixed missing url module

* added prepublish hook

* regenerated samples

* added npm build to build
2018-01-25 21:20:58 +08:00
wing328
0b4b25afff update all c# pestore samples 2018-01-25 21:17:57 +08:00
kaasasolut
6caf7699e3 Fix little bug in csharp READMEs (#7494)
* Fix little bug in csharp READMEs

* Fix another little README bug
2018-01-25 18:40:42 +08:00
Esteban Marin
20305139b5 [Feature][TypeScript] request param enum as literal unions (#7433)
* #7365: use enums string / number literals for request parameter if it is an enum

* #7365: use enums string / number literals for request parameter if it is an enum

* #7365: use enums string / number literals for request parameter if it is an enum

* #7365: improve docs

* #7365: move code to AbstractTypeScriptClientCodegen, remove redundant code in TypeScriptAngularClientCodegen, change type Object to Number in numericEnumValuesToEnumTypeUnion()

* #7365: move code to AbstractTypeScriptClientCodegen, remove redundant code in TypeScriptAngularClientCodegen, change type Object to Number in numericEnumValuesToEnumTypeUnion()

* #7365: allow parameter data type customizations

* #7365: re-enable disabled unit test assertions

* #7365: remove enum handling from type declaration generation

* #7365: generate all typescript samples

* #7365: re-enable disabled unit test assertion
2018-01-25 18:36:14 +08:00
William Cheng
6d4d9056f4
add joernahrens for refactoring dart client 2018-01-25 18:25:07 +08:00
Jörn Ahrens
a5e26a44ff [Dart] - Rework Dart client generator to be flutter-compatible (#7418)
* copy mustache templates from dart generator

* Start with generator by copying the DartClientCodegen for now

* at least we know this is not for a browser..

* First working version for a simple swagger configuration

* remove browserClient parameter, since it doesn't make sense for flutter

* Take care of complex types to support object hierarchies

* add null safety

* add small test for options

* add flutter-petstore scripts

* generate flutter petstore output

* Add new flutter test project

* move generated client to make it usable

* use generated swagger petstore plugin

* add support for lists of objects

* add DateTime support

* fix listFromJson implementation

* fix NPEs in DateTime operations + place order in sample

* Small readme changes

* bugfixes

* Use flutter-compatible implementation as default dart implementation

* fix generated samples

* Make lists serializable, now all dart test cases are working again

* better list implementation

* use StringBuffer

* removed FlutterClientCodegen

* fix browser client

* fix dependencies

* swagger-browser-client for browserClient testcases

* fix scripts

* removed flutter scripts

* add map support and simplify code via using .toJson contract

* remove unneeded devDependencies

* Regenerated samples

* fix call to mapFromJson, it is not a constructor

* remove pointless string serialization

* regenerated dart samples
2018-01-25 18:18:53 +08:00
Aykut Akin
a3c97753fe Fixes #7107 - [Rust] Handles UUID as string (#7471) 2018-01-24 12:54:57 +08:00
Articus
60e3339aa6 [Feature][PHP] Update for ze-ph generator (#7472)
* update for ze-ph generator stub to support Zend Expressive 2.1 and Path Handler 0.3

* ze-ph: for each operation generator creates special DTO model from its query parameters

* ze-ph: generation of extra TODO's for complex container type and update for samples
2018-01-24 12:36:24 +08:00
wing328
5a3a33b3c8 update java vertx server samples 2018-01-24 12:32:45 +08:00
ccozzolino
0b2d805699 Expose getter/setter for serverPort to facilitate testing (#7480) 2018-01-24 12:31:20 +08:00
William Cheng
fe22472634
add a link to ebook (polish version) 2018-01-22 23:25:48 +08:00
William Cheng
61e58d6496
Add R namespace file (#7467)
* add r namespace file

* rename NAMESPACE mustache file
2018-01-22 22:32:22 +08:00
William Cheng
cf4df630b7
Add Spring Petstore samples (async, java8-localdatetime) to CircleCI (#7468)
* add ci for spring mvc: async, localdatetime

* update artifactId for new spring samples
2018-01-22 21:35:51 +08:00
William Cheng
c3c67b6ef1
Revised core team members 2018-01-22 21:33:29 +08:00
micheleISEP
43f0e86923 Ada code generator corrected: "=>" instead of "->". Fixes #7450 (#7456)
* Ada generator generates "=>" (correct syntax) instead of "->". Fixes #7450

* Updated the Ada petstore samples

* Committing "VERSION" file and the rest of the petstore samples
2018-01-22 17:40:34 +08:00
Neeme Praks
fe2a443394 Fixes issue #7177 (SpringCodeGen dateLibrary "java8-localdatetime" option is ignored). (#7178) 2018-01-22 17:31:13 +08:00
jarlesat
5ea3d3bb18 Issue-7438 Fix that prevents generating interfaces when interfaceOnly is false. (#7439) 2018-01-22 15:57:17 +08:00
Reijhanniel Jearl Campos
9e1bbe0c1c #7093 - Add maven wrapper (#7356) 2018-01-22 14:35:34 +08:00
wing328
6651f6bfa1 Merge remote-tracking branch 'origin/2.4.0' 2018-01-22 14:16:55 +08:00
Jim Schubert
8724719960 [csharp] Support arrays of arrays for properties and models (#7400)
* [csharp] Support composition on toJson

Previous implementation assumed specification only supports polymorphic
associations (via discrimator), although the code didn't seem to be
setup correctly for that in the first place. That is, the parent object
must define the discriminator (see
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#models-with-polymorphism-support),
so NOT HAS parent AND HAS discriminator doesn't make sense.

From a C# perspective, base classes should have the method marked
virtual and derived classes should override the method. This supports
both composition and polymorphic definitions.

* [csharp] this.Configuration in api template

Unprefixed Configuration property access leads to ambiguous references
when spec defines a Configuration model.

* [csharp] Models/properties support nested arrays

Previous implementation didn't support multiple levels of array with
array items as OpenAPI spec supports. This means an object defined as
type: array with items = type: array|items=double (which is common in
GIS) would not be possible.

This implementation assumes generics in the nested type definitions, so
the above would generate List<List<double?>> for model parent types as
well as property type declarations.

* [csharp] Regenerate integration test sample

* [csharp] Set "Client" case sensitive as reserved

* [csharp] Regenerate security sample

* [csharp] Regenerate samples
2018-01-22 14:14:17 +08:00
Jim Schubert
1c4e6b7d46 [csharp] Fix ToJson to work with composition and polymorphism (#7399)
* [csharp] Support composition on toJson

Previous implementation assumed specification only supports polymorphic
associations (via discrimator), although the code didn't seem to be
setup correctly for that in the first place. That is, the parent object
must define the discriminator (see
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#models-with-polymorphism-support),
so NOT HAS parent AND HAS discriminator doesn't make sense.

From a C# perspective, base classes should have the method marked
virtual and derived classes should override the method. This supports
both composition and polymorphic definitions.

* [csharp] Regenerate integration test files

* [csharp] Regenerate samples

* [csharp] Regenerate security sample
2018-01-22 14:13:50 +08:00
Jim Schubert
ed7af73f6b [csharp] Reference this.Configuration in client api template (#7394)
* [csharp] this.Configuration in api template

Unprefixed Configuration property access leads to ambiguous references
when spec defines a Configuration model.

* [csharp] Regenerate samples
2018-01-22 14:04:19 +08:00
jarlesat
99fc272465 [JAX-RS][Spec] Removes throws Exception. (#7437)
* Issue-7435 Removes throws Exception.

* Issue-7435 Updates jaxrs-samples.
2018-01-22 13:48:59 +08:00
Tobias Wich
524f162e63 Use supportsES6 flag in ts compilation for language typescript-angular (#7408) 2018-01-22 13:40:20 +08:00
Stephane Carrez
7d2b49085f Fix 7457: [Ada] wrong order for generated structures in *-models.ads (#7462)
* Fix the comparison between two model types to compare them recursively
and make sure we sort the model types according to their dependencies

* Run bin/ada-petstore.sh to update the generated Ada client samples
2018-01-22 13:27:39 +08:00
Stephane Carrez
2b2b85eec7 Fix 7459: [Ada] wrong JSON in POST operations (#7460)
* Fix Ada client generated code to avoid having a spurious body name for parameters passed in the body

* Run bin/ada-petstore.sh to update the generated Ada client samples
2018-01-22 13:21:09 +08:00
Tristan Sloughter
c73118524c [erlang-client] Erlang request utils (#7257)
* [erlang-client] fix body param from being included path and base path to remove host

* [erlang-client] move request logic out of api functions to utils module

* [erlang-client] add support for passing http client configuration to requests

* [erlang-client] update auth handling

* [erlang-client] remove underscore2, replacing with original underscore + replaceAll
2018-01-22 13:18:35 +08:00
wing328
01a076c3fe reenable pushing snapshot to maven repo 2018-01-21 23:21:42 +08:00
William Cheng
e7c9ab344c
Create CODE_OF_CONDUCT.md 2018-01-21 23:02:06 +08:00
William Cheng
174b14ba1e
Merge pull request #7426 from swagger-api/2.4.0
Merge 2.4.0 into master
2018-01-21 23:01:21 +08:00
wing328
6b7b8771cf comment out update to docker image 2018-01-21 21:52:24 +08:00
magnolia
6db63c7a1f deleted unnecessary notes (#7454)
https://github.com/swagger-api/swagger-codegen/issues/7398
2018-01-20 14:31:43 +08:00
ccozzolino
59ff4c198b [Java][library: vertx] Add default value and required parameter support to vertx server temp… (#7410)
* Add default value and required parameter support to vertx server templates. Fix for #7409.

* Added missing serviceId declaration to workaround #allParams section clearing the vendorExtensions map
2018-01-20 14:31:06 +08:00
Esteban Marin
ef832e7157 [Feature][Angular] improve docs angular import (#7363)
* #7354: improve docs about importing multiple ApiModules, prevent https://github.com/angular/angular/issues/20575#issuecomment-356261374

* #7354: prevent https://github.com/angular/angular/issues/20575#issuecomment-356261374 add error message about importing the HttpModule / HttpClientModule

* #7354: generate sample files

* #7354: generate README.md also for non-npm packages
2018-01-20 14:24:33 +08:00
Jinkui Shi
197b4481ef [doc] akka-scala and Java README normalize (#7382)
* normalize scala-akka and Java README.mustache

* move version info to the project info section
2018-01-20 14:15:16 +08:00
Alessio Fachechi
6bf84d5fa7 fix of issue #7386 (#7401) 2018-01-20 14:05:32 +08:00
Kane Lai
a61d23265d Fixed incorrect renaming of header and query param to camel cases for Kotlin Client template (#7420)
* - Fixed incorrect renaming of header and query param to camel cases

* Generated petstore code base on modified Kotlin template
2018-01-19 17:30:04 +08:00
chiman-jang
8e270f4651 add vendorExtensions field in CodegenSecurity class (ref: #7236) (#7415) 2018-01-19 16:24:10 +08:00
magnolia
7853308c8e Rebuild Scalatra sample (#7431)
When creating the following PR, sample was generated without reflecting the last change.

https://github.com/swagger-api/swagger-codegen/pull/7393

With this commit, it will be synchronized
2018-01-19 16:20:41 +08:00
magnolia
1ee85de94e Added Intelli J ignore (#7423)
.idea
*.iml
2018-01-19 16:20:12 +08:00
etherealjoy
ea4b948428 [qt5cpp] Add nullptr guard to prevent crash when empty model is being serialized (#7434)
* Small fixes to prevent crash when empty json body is provided.

* Updated PetStore example for Qt5
2018-01-19 15:36:45 +08:00