Commit Graph

6089 Commits

Author SHA1 Message Date
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
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
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
ccozzolino
0b2d805699 Expose getter/setter for serverPort to facilitate testing (#7480) 2018-01-24 12:31:20 +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
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
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
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
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
William Cheng
30c1448d78
Fix build.gradle for Java RESTEasy client (#7448)
* update release 2.3.1

* add jeff9finger to java tech committee

* fix build.gradle for java resteasy
2018-01-19 13:21:39 +08:00
magnolia
7b8e409cf9 Added gitignore generation function (#7402)
Copy gitignore template from client
2018-01-15 21:00:26 +08:00
Jinkui Shi
612cfb7af4 [Akka-scala] Clean unused dependencies such swagger-core #7329 (#7329) 2018-01-15 14:14:10 +08:00
Euan Kemp
027df610b1 [Rust] Handle error response statuses (#6865)
* [Rust] Consider error statuscodes to be errors

* [Rust] Introduce 'ApiError' type for 4xx/5xx resp

This updates the previous commit which added an 'ErrorStatus' variant to
an 'ApiError' variant.

It does not specialize the error to the specific possible error
responses yet, rather returning a 'serde_json::Value' for any case.

This will lose any error messages which cannot be parsed as json and
instead return a json-parse error.

A future change should update the generated signatures such that the
returned future's error type is specialized to the specific errors that
may be returned by that api (and possibly a catchall json::Value still).

* [Rust] Regenerate petstore samples

* [Rust] Add error example to petstore sample
2018-01-15 11:38:11 +08:00
wing328
15e7255154 Merge branch 'issue-7044' of https://github.com/joeboyscout04/swagger-codegen into joeboyscout04-issue-7044 2018-01-14 23:41:46 +08:00
wing328
44211c8811 Merge branch '2.4.0' of https://github.com/swagger-api/swagger-codegen into 2.4.0 2018-01-14 23:19:28 +08:00
Carl E Leiby
72221b1cf9 Adding @Deprecated to retrofit2 client interfaces. 2018-01-14 23:17:45 +08:00
Reijhanniel Jearl Campos
3bd2da9a8b [Java] #3204 - Fix build warnings (#7364)
* [Java] #3024 - Add build-helper-maven-plugin version to retrofit client template

* [Java] #3024 - Add build-helper-maven-plugin version to feign client template

* [Java] #3024 - Add build-helper-maven-plugin version to jersey client template

* [Java] #3024 - Add build-helper-maven-plugin version to resteasy client template
2018-01-14 21:13:56 +08:00
wing328
44853c31b6 update rust default user agent to promote swagger codegen 2018-01-14 18:25:04 +08:00
Tristan Bourvon
66be7a7910 [Rust] Add user agent handling for rust template (master) (#7375)
* Add user agent handling for rust template

* Run ./bin/rust-petstore.sh
2018-01-14 18:18:58 +08:00
magnolia
d5c355a596 [Scalatra] Updated the version of Scalatra to the latest (2.6.2) (#7393)
* Updated the version of Scalatra to the latest (2.6.2)

 - Updated Scalatra 2.6.2 (latest)
 - Updated Scala 2.12.4
 - Updated sbt 1.1.0
 - Reduced dependent artifacts to a minimum
 - Cleaned up build.sbt
 - Changed the package name from client to server
 - Set log output (logback)
 - Updated web.xml for servlet 3.1

* rename package 'com.wordnik' -> 'io.swagger'

* Added rolling file appender to logback.xml
2018-01-14 18:11:37 +08:00
etherealjoy
0bf430a803 Qt5cpp Add support for nested containers (#7340)
* Disable creation of empty json fields and fields for primitives which were not set, but using default values
modelnamePrefix will be the one passed from command line or SWG if none

* Updates after review
Also common http files are splitted
Update Petstore examples

* Small Fixes for cleaning up arrays of arrays/maps

* Changes
- Api Body pass by Reference, avoid seg fault due to deletion of auto constructed object passed as parameter.
- Support Maps and Arrays upto a depth of 2
- Refactor Helpers to handle Maps and simplify code

* Remove size check due to possible incorrect type

* Update PetStore Examples for Qt5 C++ and small fixes for QDate/QDateTime

* Updates after review. Fixes typo and remove usage of auto keyword.

* Restored usage of auto keyword.
2018-01-14 17:47:54 +08:00
Ben Mordue
429b96ae7e [JAVA] equals and hashCode for models with byte[] and binary strings (#7341)
* equals and hashCode methods for POJOs with byte array vars

* Also fix equals and hashCode for binary vars

* Ran script to update samples
2018-01-14 17:39:32 +08:00
Marian Steinbach
90859575eb Fixing variable name typo (instane -> instance) (#7353) 2018-01-14 17:37:37 +08:00
wing328
97298bdb03 Merge branch '2.4.0' of https://github.com/swagger-api/swagger-codegen into 2.4.0 2018-01-14 17:14:43 +08:00
sneumann
9e06f7063f Fix assignment of new object instance to variable (#7379)
* #7359 Fix - use reflection to instantiate non-generated class (#7360)

* add tests for java vertx petstore

* add swagger example to README.md (#7368)

* Fix assignment of new object instance to variable

Fixes `Error in foobar$fromJSONString(s) : object 'CategoryObject' not found`
Discussion in https://github.com/swagger-api/swagger-codegen/issues/6520#issuecomment-357132746 ,
thanks @wing328 for encouraging.
2018-01-14 17:14:35 +08:00
Euan Kemp
0f6696089f [Go] Use consistent indentation in readme (#7336)
* [Go] Use consistent indentation in readme

* [Go] Regenerate petstore sample
2018-01-14 17:05:18 +08:00
antihax
72abb20f2e [Go] Fix operation files clobbering model files. [2.4.0] (#7337)
* Prevent operation files clobbering model files.

* Update Tests
2018-01-14 17:00:17 +08:00
Illia Ovchynnikov
642c0566de Use Rx2 Completalbe for Void Retrofit2 responses 2018-01-13 14:15:44 +01:00
wing328
73c338be58 Merge remote-tracking branch 'origin/master' into 2.4.0 2018-01-13 15:54:41 +08:00
wing328
4bdaf37ca5 update pom.xml in swagger components to 2.3.1 2018-01-13 15:45:05 +08:00
William Cheng
8aef689d1b
[Java] allow setting boolean getter (is, has, get) in templates (#7344)
* allow setting java boolean getter (is, has, get) in templates

* update msf4j boolean getter

* update jaxrs-spec boolean handler

* update jaxrs boolean getter

* update reasteasy, spring, cxf boolean getter

* update inflector boolean getter

* update java play boolean getter

* update java boolean getter

* update spring samples
2018-01-13 15:19:02 +08:00
SergeyLyakhov
4241b11d97 [Java][jersey2] Fix logging for jersey2 + java6 (#6715). (#7348)
* [Java][jersey2] Fix logging for jersey2 + java6 (#6715).

* Fix formatting according to comments.
2018-01-12 21:16:23 +08:00
Jim Schubert
75c0180c71 [scala] Escape reserved words, support Array[Byte] (#7378)
* [scala] Escape reserved words, support Array[Byte]

Previously, Array[Byte] was compiling to ArrayByte. This provides a type
mapping to output the correct type.

This also escapes reserved words with grave accents, as is most common
in Scala. Escaping with an underscore prefix breaks serialization (in
Jackson, for example) unless templates are modified manually. Escaping
using grave accent should unblock most serializers from requiring
template modifications.

* [scala] Regenerate integration test outputs

* [scala] Regenerate samples

* [scala] Remove unused imports in related codegen files
2018-01-12 21:14:30 +08:00
ccozzolino
247fbd4435 #7359 Fix - use reflection to instantiate non-generated class (#7360) 2018-01-11 16:31:37 +08:00
wing328
3930b5b0a1 Merge remote-tracking branch 'origin/master' into 2.4.0 2018-01-11 13:40:35 +08:00
Five & Done
1bb9207c9b Standardize all isRestfulxxx methods. (#7352)
* [Scala] Fix async helper methods when body is optional (#7274)

* [Scala] Fix async helper methods when body is optional

Closes #7272

* Update petstore sample

* Standardize all isRestfulxxx methods.

Change 'equals' method to 'equalsIgnoreCase' for isRestfulIndex method in Operations.  This matches isRestfulCreate, isRestfulShow, isRestfulDestroy
2018-01-11 12:48:37 +08:00
Jim Schubert
65bda3e7b6 [scala] updates for client default values, required attributes (#7286)
* [scala] Fix default values in scala client

This uses consistent logic for optional types with default values in the
scala client. Also, uses Option(default) instead of Some(default) to
guard against people defining defaultValue = null. Option(null) becomes
None while Some(null) defines a null value explicitly and will break
maplike operations.

* [scala] Regenerate client sample

* [scala] Add missing json4s import, which will be added by another PR but allows current samples to generate

* [scala] Include integration tests for required attributes support

* [scala] Support string types with formats

This adds support for better support of type=string and
format={date,date-time,binary,byte}. Previously, binary and byte were
inconsistently defined as strings rather than byte arrays, while
date/date-time were parsing default values into formats that did not
match OpenAPI/Swagger 2.0 specifications for full-date and date-time.

We may want to consider pulling in json4s-ext to support wider date
formats and moving to date=LocalDate and date-time=ZonedDateTime.

This will have breaking changes for consumers expecting binary/byte to
be strings rather than byte arrays.

* [scala] Unique parameter names in integration test, to avoid seemingly conflicting names

* [scala] Regenerate client sample

* Sort file listings in AssertFile.java

Per File#list() javadocs:

There is no guarantee that the name strings in the resulting array
will appear in any specific order; they are not, in particular,
guaranteed to appear in alphabetical order.

I'm unable to repro directory listing failures on OS X High Sierra or
Ubuntu 16.04 under Parallels, so it's not clear to me if listing order
is indeterminate per-platform or the behavior is just not defined and
up to the platform's installed runtime. Sorting the array of strings
prior to comparison should resolve this issue on every platform/runtime.

* [scala] exclude api tests for integration test gen script

Script should match options in the integration test class

* [scala] Temporarily disable client integration tests

CI doesn't seem to pick up template changes in integration tests.
Disabling scala client integration tests, pending investigation of the
issue.

* [scala] Remove redundant json4s import

* [scala] Regenerate integration test

* [scala] Regenerate sample
2018-01-10 13:24:57 +08:00
Jean-François Côté
ebf4efe3ea Fix issue #6867 : The apiPackage option was ignored (#7316)
* Fix issue #6867 : The apiPackage option is ignored in the template for Java Play Framework.

* use openjdk7 in travis to ensure it works with jdk7
2018-01-10 13:15:49 +08:00
Greg Marzouka
7cc738aa7c [Scala] Fix async helper methods when body is optional (#7274)
* [Scala] Fix async helper methods when body is optional

Closes #7272

* Update petstore sample
2018-01-10 00:30:56 +08:00
Joseph Elliott
673be4e88f exclude commons package from org.apache.oltu.oauth2 to provide a more long-term fix. 2018-01-08 14:41:57 +01:00
Joseph Elliott
c642d8a89b Roll back oltu_version to 1.0.0 to fix #7044 2018-01-08 14:25:32 +01:00
wing328
16e3226c8a Merge remote-tracking branch 'origin/master' into 2.4.0 2018-01-08 18:01:20 +08:00
Mehdi Jouan
c7f12d6c2d [Spring][Java] fix support of long values for @Max and @Min annotations (#7227)
* add support of long values for @Max and @Min annotations

* run shell scripts for java and spring

* fix import issue after running shell script
2018-01-08 00:22:06 +08:00
William Cheng
f7779c545e
refactor abstract scala codegen (#7334) 2018-01-08 00:20:38 +08:00
wing328
a85162fe33 Merge branch '2.4.0' of https://github.com/swagger-api/swagger-codegen into 2.4.0 2018-01-08 00:15:26 +08:00
wing328
99823c04b9 update Swift4ModelTest.java with _id 2018-01-08 00:13:49 +08:00
wing328
0a6826d284 Merge branch 'ehyche_update_reserved_words_swift4' of https://github.com/ehyche/swagger-codegen into ehyche-ehyche_update_reserved_words_swift4 2018-01-08 00:05:49 +08:00
Sunrin SHIMURA
f5adbec1ff [Rust-Server] Use string literal based mime initialization (#7212)
* Use string literal based mime initialization to avoid invalid token error

* canonicalize mimetypes before checking
2018-01-08 00:00:12 +08:00
wing328
e51223eef1 Revert "Replaced \t with spaces (#7265)"
This reverts commit 14a2c81adb.
2018-01-07 23:46:33 +08:00
ccozzolino
d9745962be [Java:vertx] Initialize router in init method and re-use router member to create S… (#7234)
* Initialize router in init method and re-use router member to create SwaggerRouter

* Added generated samples for 7320 fix

* Fixed alignment to 4 spaces for 7320 fix
2018-01-07 23:37:37 +08:00
Jean-François Côté
193432ef52 Added optional extra JQueryAjaxSettings at the class and function level (#7238) 2018-01-07 23:21:43 +08:00
wing328
007974e3de Merge remote-tracking branch 'origin/master' into 2.4.0 2018-01-07 23:13:24 +08:00
craffael
9a284776d8 [Java] Fix serialization of the discriminator field when using GSON (#7075)
* set discriminator on object construction...

* regenerate all java samples

* run bin/java-msf4j-petstore-server.sh

* remove extra newline
2018-01-07 23:10:32 +08:00
Greg Marzouka
14e7158164 [Scala] Fix missing json4s import (#7271)
* [Scala] Fix missing json4s import

Closes #7270

* Update petstore sample
2018-01-07 22:50:30 +08:00
westse
ea3d039717 [scala] make stripPackage name configurable via property (#7226)
* Make stripPackage name configurable via property
- Needed because some APIs (e.g. Kubernetes) include version information in packages. Stripping causes many generated API and model classes to be named the same, causing a last-one-wins situation which is unacceptable.

* Per PR review, ensure stripPackageName Boolean property and log warning
2018-01-07 21:47:25 +08:00
wing328
b7f4f3e058 Merge branch 'csharp-enum-cleanup' of https://github.com/jimschubert/swagger-codegen 2018-01-07 19:11:40 +08:00
Stephane Carrez
362625bfa9 [Ada] Add Ada support for server code generator #6680 (#7256)
* Add Ada client petstore samples
- Add script to generate Ada client support with swagger-codegen
- Add files to build the Ada sample
- Add main program to use the generated client samples API
  and connect to the server to perform some operations

* Add some description for the samples

* Update the documentation to explain how to build, how to use the generated Ada client code

* Add server support for path parameters
- Update postProcessOperations to scan each path parameter and emit a x-path-index
  vendor attribute to tell the index of the path parameter

* Add and fix Ada server code package declaration
- fix declaration of operations
- generate a generic package that must be instantiated with the target server implementation
  and which provides the skeleton (deserialization and serialization of data)

* Implement the Ada server side operations
- extract body, query parameters, path parameters
- serialize the result
- register operations to the server according to the path/routes

* Update the code generation to generate server Ada implementation code

* Improvement of Ada server support: generate the swagger.json template file

* Define toModelName operation to the creation of a model identifier

* Add support for server permission generation
- collect the security scopes in postProcessAuthMethod() method and make sure
  these scopes have unique identifiers.  Some scopes correspond to URLs
  but others correspond to pseudo identifiers.

* Use the #lambdaAdaComment filter to indent correctly a multi-line description

* Fix model generation to support arrays

* Update the generated GNAT project file

* Refactoring and improvement of server code generation
- Change the server generated code to pass a Context_Type object
  to allow the server implementation to get/set headers in the request/response
  and control what is put in some responses
- Generate the security permissions based on the scopes that have been collected

* Server code generation improvement
- Fix generation of GNAT project
- Generate the intermediate Ada packages if necessary
- Generate the server main

* Ada server main template

* Ada server code improvement
- Add support to generate server permission verification
- Fix the GNAT project definition
- Templates for Ada intermediate packages

* Skeleton for the server side implementation

* Generate an empty Ada server implementation

* Templates for the Ada server implementation

* Add a README.md file and a GNAT config.gpr file

* New templates to document the generated Ada server

* Add server configuration file for the Ada server

* Fix the log message in the Ada server to report the correct URI to connect to

* Generate the Ada server configuration file

* Improvement of Ada code model to support nullable types

* Update the Ada server templates

* Refactor the Ada code generator
- separate the Ada client and Ada server code generators
- register the Ada server code generator under the name 'ada-server'
  keep 'ada' for the client Ada code generator
- moved the common Ada code operation supports to the AbstractAdaCodegen

* Improvement and cleanup of Ada client and server code
- new template for the client main program
- fix the GNAT project template for client or server programs
- remove unused options to better use the --model-package option

* Fix the GNAT project file name to use a lower case name
Fix the default GNAT config
Fix the headers of intermediate Ada package files

* Regenerate the model and client Ada files

* Update the Ada client sample to take into account the Nullable types

* Regenerate some files with Ada Swagger Codegen

* Ignore generation of petstore.gpr
2018-01-07 18:44:20 +08:00
etherealjoy
c7ff303779 [qt5cpp] Disable creation of empty json fields and handle prefix in model generation (#7206)
* Disable creation of empty json fields and fields for primitives which were not set, but using default values
modelnamePrefix will be the one passed from command line or SWG if none

* Updates after review
Also common http files are splitted
Update Petstore examples
2018-01-07 17:50:44 +08:00
wing328
0469975632 minor enhancement to scala gatling 2018-01-07 17:38:55 +08:00
ryandavis84
6d2d4298df Gatling generator2 issue #6927 (#6934)
* Initial commit, Generates everything necessary to run a performnace test against a swagger api.  Just have to fill out the CSV feeder files with your data.

* adding samples and gatling-petstore.sh file

* Extending the AbstractScalaCodeGen

* Checking in the CodegenConfig file as it is needed to generate

* removing escaped reserved words

* Changed model to be able to make all variables utilize an underscore while json fields are still just the variable name

* Changing underscore to var as interpolation can not start with a _ in scala

* Fixing path params

* allow you to pass in a system property to define which config to use as a workload profile, use rate and instance multipliers to scale up and down your test, added ramp down after the test is completed, added global assertions.

* Addressing PR feedback

* missed semi-colon

* Bringing everything up to date with the renames that were suggested
2018-01-07 17:18:36 +08:00
ehyche
97ad90578d Split up model template into partials (#7297) 2018-01-07 16:57:58 +08:00
Jon Schoning
bca2b9fb5b [haskell-http-client] handle */* mimetype correctly & split api modules & allowNonUniqueOperationIds (#7254)
* [haskell-http-client] handle */* mimetype correctly

* [haskell-http-client] generate separate api modules, for each child api

* [haskell-http-client] add cliOption "allowNonUniqueOperationIds"

When cli option "allowNonUniqueOperationIds" is true,
allows *different* API modules to contain the same operationId,
and then each API must be imported qualified.
2018-01-07 11:59:55 +08:00
Oleksandr Slynko
919f867eba [go] Fix go client formatting (#7283)
* Fix some go client formatting issues

* Fix go client go imports

* Run `goimports -w .` on examples directory

* Sort imports in api

* Add new line between each property

Before secret feature was used to add new line using two property
declaration in the same line. There should be no new line before
first property. The easiest way is to use `-first` special
property
https://github.com/samskivert/jmustache#-first-and--last

New line are required so `goimports` won't reformat  whitespaces between
property name and type.

* Change whitespaces to tabs

* Fix whitespaces in api_client

There is a new line between each service to prevent `goimports` from
adding whitespaces between types and names

* Fix more whitespaces

There was a need to set special delimeter for formatting in the commit.
Go slices use curly braces and `jmustache` got confused when found
triple curly braces.

* Fix whitespaces in configuration.mustache

* Fix whitespaces for api response

* Support for optional description

Do not add whitespace if description is missing

* Add new lines between enum values to prevent formatting

* Generate go code from current code

- imports are not sorted :(
- there are extra whitespaces for different languages. I don't know why

* Run generate for security tests
2018-01-07 11:53:55 +08:00
etherealjoy
6afc0e9344 Fix for #7198, use QJsonObject instead of QJsonArray for maps (#7204)
[C++][Qt5] use QJsonObject instead of QJsonArray for maps
2018-01-07 11:50:22 +08:00
Dennis Kieselhorst
ee5709177a [Java] update CXF to latest release (3.2.1) (#7284)
* update CXF to latest release (3.2.1)

* update CXF to latest release (3.2.1) - samples update
2018-01-07 11:43:34 +08:00
Bernat Ràfales
9b5bba0193 Correct minor typo in Ruby gemspec files (#7263)
[Ruby] Correct minor typo in Ruby gemspec files
2018-01-07 11:41:14 +08:00
marcindanek85
14a2c81adb Replaced \t with spaces (#7265)
* Added copying array type descriptors (isBoolean, isNumber, etc) to specify the type of items in array

* Replaced \t with spaces
2018-01-07 11:40:10 +08:00
Ben Wells
7479fc5361 Generate swagger yaml for go client (#7281) 2018-01-07 11:37:40 +08:00
Akihito Nakano
fa9fc4b45b Delete ApiClient (#7305) 2018-01-07 11:34:17 +08:00
Akihito Nakano
68a4552741 Tweak test doc comment (#7280) 2018-01-07 11:23:05 +08:00
William Cheng
4bb6d8993c
fix removeOperationIdPrefix in additional properties (#7301) 2018-01-07 11:15:13 +08:00
wing328
7f0dca7ac2 update version to 2.4.0-SNAPSHOT 2018-01-07 11:04:05 +08:00
Jinkui Shi
30bd6f680d [akka-scala] License info add in template header #7321 (#7322)
* [akka-scala] License info add in template header #7321

* generate petstore by akka-scala teplate
2018-01-07 11:00:57 +08:00
Jean-François Côté
3465f2918e Fix a regression bug that was introduce in a recent commit. Removed the tabs that were causing error in Play Framework (#7241) 2018-01-07 10:48:49 +08:00
Jean-François Côté
0a9c6f56c8 Fix issue #7262 with the parameter name in the path. The problem was that camelCase naming was forced only in this part of the code when everywhere else it is configurable. (#7313) 2018-01-07 10:33:46 +08:00
Aaron McGinn
6c2a583bcd Java8 fix (#7260)
* [JavaPKMST-Server] Change Java 8 code to Java 7 to meet project specifications

* Revert "Update readme to Java 8"

This reverts commit 54ce4caafc.
2018-01-07 10:32:40 +08:00
wing328
9c68c00fa5 update to 2.3.1-SNAPSHOT 2018-01-07 09:53:01 +08:00
Eric Hyche
6c6cf1c09c Re-organize the reserved words for Swift4 2018-01-02 10:32:55 -05:00
wing328
21f8d5fb1b Revert "update version to 2.4.0-SNAPSHOT"
This reverts commit 8d2fa6b8ea.
2017-12-22 12:07:26 +08:00
wing328
8d2fa6b8ea update version to 2.4.0-SNAPSHOT 2017-12-22 11:42:05 +08:00
wing328
ea9340e84d update version to 2.3.0 2017-12-22 10:45:02 +08:00
manuc66
a050907d1f fix net35 with JsonSubTypes (#7043)
* upgrade JsonSubTypes to 1.2.0

* update samples

* add SwaggerClientNet35

* re-generate

* fix the linux build script
2017-12-22 00:31:44 +08:00
William Cheng
587dc20e06
[Javascript] Set ES5 as default (#7239)
* default js client to es5

* update js option wording
2017-12-22 00:08:30 +08:00
Jean-François Côté
572bafe2a7 #7201: Take the modelPropertyNaming property into account again (#7202) 2017-12-21 18:28:30 +08:00
Ramzi Maalej
9dde8525ec [Akka-Scala] This is a fix to a bug introduced by this PR #7172 (#7228)
* Add missing import

* Update petstore app
2017-12-21 10:56:36 +08:00
Erik Timmers
d6539ba3c8 Add Elm language - BETA (#6947)
This is the initial Codegen for Elm 0.18.
Please try it out and provide feedback.

Not yet supported:

* path variables;
* additionalProperties;
* authentication;
* recursive types.
2017-12-20 22:26:46 +08:00
Jon Schoning
538f28e568 bump stack resolver to lts-10.0 (#7221) 2017-12-20 21:55:23 +08:00
Ben Wells
83fb107749 Create abstract go codegen base class (#7197)
Remove tabs
2017-12-19 23:41:02 +08:00
William Cheng
350a97095b
[Go] rename local variable "file" to "localVarFile" (#7214)
* comment out pkmst test for the time being

* rename file to localVarFile
2017-12-19 23:12:12 +08:00
William Cheng
bd19111ff0
[Java][PKMST] Move resource folder (#7213)
* comment out pkmst test for the time being

* move pkmst resource folder
2017-12-19 22:16:16 +08:00
William Cheng
41aa80ada7
[TS][Fetch] Use unescaped media type value (#7210)
* comment out pkmst test for the time being

* use unescaped mediaType in TS fetch
2017-12-19 18:21:22 +08:00
William Cheng
37cd8b52d0
[Java][PKMST] rename pkmst to java-pkmst, update scripts/batch files (#7209)
* rename pkmst to java-pkmst, update scripts/batch files

* update pkmst batch file
2017-12-19 17:25:48 +08:00
Asad Saeeduddin
a3ca8d55e2 [TypeScript-Fetch] Support for non-JSON body params (#6994)
* Commit leftover snapshot changes

* Add logic to deal with non-JSON body params

If the spec specifies a list of consumes MIME types, default to the
first MIME type in the list instead of "application/json" (the user may
still override this by passing "Content-Type" in options.headers).

Additionally, only perform explicit JSON serialization if the data type
of the body parameter is not "string", or if it is string, only when the
content type is "application/json".

* Update snapshots
2017-12-19 17:20:16 +08:00
sanshuman
cb59591eff pkmst- Prokarma microservice toolkit for java (#7023)
* Added pkmst-microservice toolkit

* formatted

* replaces tab with blank spaces

* adding documentation folder

* adding documentation folder

* Update readme.mustache

Added feature set offered by pkmst

* updated readme

* Update io.swagger.codegen.CodegenConfig

Arranged pkmstServerCodeGen and SymfonyServerCodegen in aphabatical order

* Update readme.mustache

* renamed according to convention and added typeinfoannotation

* removed tabs

* updated codegen which extends abstractjavacodegen

* Added the script files and rectified the errors

* folder name changed and commons -lang3 version upgraded

* updated readme.mustache

* updated logging filter

* Added petstore to samples and updated the pom for the same

* Added java-pkmst sample to pom.xml.circleci

* updated readme.mustache
2017-12-19 16:12:44 +08:00
Sunrin SHIMURA
7d96f61e5d [Rust-Server] use status codes as the variants of the response enums instead of descriptions (#7125)
* use status codes in the variants of the responses instead of message

* samples

* add missing {{code}}

* use human friendly idents if possible

* generate samples

* salvage an oversight
2017-12-19 14:40:35 +08:00
antihax
dc69138de5 Go: Return error body with >= 300 errors (#7192)
* Report better errors

* update tests
2017-12-18 23:03:47 +08:00
David Noel
ad7a8200f0 Issue #6471 Add java8, interfaceOnly, delegatePattern to generated server stubs (#6476)
* java 8 interface only delegate method mode

* typo correction

* Update samples with ./bin/spring-all-petstore.sh

* change delegate prefix to "do" and make delegate method a default method that returns an OK status code

* remove temp debug printout

* prefix spring annotated method with "_" to indicate that is private

* resolve merge issues from Merge of remote-tracking branch 'upstream/master'

* tuned whitespace in api.mustache and re-ran spring-all-petstore.sh

* removed special spring cloud library check as it was no longer being referenced in api.mustache
re-ran spring-all-petstore.sh
2017-12-18 22:43:15 +08:00
Ben Wells
6349e79a59 Fix typo in Petstore yaml (#7195) 2017-12-18 12:30:57 +08:00
Ben Wells
d25341d58d Output models for go-server #3851 (#7188)
* Output swagger models.

Fix route verbs and formatting

* Remove backup files

* Make postProcessOperations consistent with go client
2017-12-17 21:55:20 +08:00
Ville Skyttä
8f2ed1c503 Run logo.png through zopflipng -m (#7187) 2017-12-17 14:43:37 +08:00
Christophe Bornet
79326399ef Fix starting springboot server from IDE (#7184) 2017-12-16 11:19:31 +08:00
elion
20ace869b7 Issue 7151 2.3.0 (#7181)
* Removed redundant version declaration. Upgraded Spring boot dependency version.

* Update samples
2017-12-15 21:04:00 +08:00
Jinkui Shi
be50955bbf [akka-scala] template upgrade dependency version and refactor #7171 (#7172)
* [akka-scala] template upgrade dependency version and refactor #7171

* update sbt dependencies version and add enforce plugin

* delete new to the case class
2017-12-15 00:47:10 +08:00
etherealjoy
4b4528317c Fixes segmentation faults for arrays of primitive types (#7099)
[C++][Qt5] Fixes segmentation faults for arrays of primitive types
2017-12-15 00:38:42 +08:00
wing328
f1c52dc97e Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-12-15 00:31:41 +08:00
Ben Wells
2e348b27f7 [Go-server] Fix formatting of go-server generated code (#7162)
* Add missing go-server petstore batch script

* Make go-server confirm to gofmt
2017-12-15 00:04:48 +08:00
wing328
6693e8bc10 Merge branch 'fix-model-javadoc-whitespace' of https://github.com/nemecec/swagger-codegen into nemecec-fix-model-javadoc-whitespace 2017-12-14 23:59:04 +08:00
Jean-François Côté
e70bdf17f2 [Typescript All] Prevent usage of reserved keyword for model fields (#7112)
* Prevent usage of reserved keyword for model fields

* Changes from code review to follow JS convention of using toParamName and toVarName

* Another small change from code review. Removing from postProcess because it is already called from somewhere else.
2017-12-14 12:47:02 +08:00
Max K
a96bc3a409 Added support for controller action parameter validation into the ValidateModelStateAttribute (#7156) 2017-12-14 12:26:57 +08:00
Max K
5306372b98 Added Contact NAME to Startup.cs (#7168)
* Ran bin/aspnetcore-petstore-server.sh

* Added contact information to startup.cs

* updated to support NAME as well

* updated samples

* updated NAME default
2017-12-14 01:31:11 +08:00
Max K
5e4d363675 [AspnetCore Server] Added Original swagger (#7170)
* Updated Codegenerator as well as added new swagger-original mustache template

* updated Startup.cs template to provide guidance for original Swagger file

* Updated Sample
2017-12-14 00:57:16 +08:00
Neeme Praks
b2de0e6df6 Fixes issue #7167 (One space too many before JavaDoc first line in model methods). 2017-12-13 12:51:08 +02:00
William Cheng
81c0e81c77
Add "Contact" name, URL (#7164)
* update swagger parser, core version the latest

* add info name and email
2017-12-13 18:10:01 +08:00
Max K
c496ec7269 Added support for VERSION, APPNAME and CONTACT from Swagger file into Startup.cs (#7103)
* Added support for VERSION and APPNAME from Swagger file into Startup.cs for Swashbuckle SwaggerGen

* Ran bin/aspnetcore-petstore-server.sh

* Added contact information

* Added contact information to startup.cs
2017-12-13 12:03:33 +08:00
Max K
1541d96b18 Updated SwaggerResponse Attributes so they use the actual dataType instead of the common returnType (#7096)
* Moved SwaggerResponse Attributes to use the respective dataType instead of the common returnType.

* Updated examples
2017-12-13 11:59:45 +08:00
Benjamin Gill
4dbb44b061 End use of deprecated openssl method (#7154) 2017-12-13 11:31:11 +08:00
Bartek Kryza
8b61b1d466 #7047 - Added Bash syntax check to tests (#7155) 2017-12-13 11:14:07 +08:00
Max K
9ca63955c2 Added support for Operation EXAMPLE value in ASP.NET Core Generator. (#7091)
* Added support for Operation EXAMPLE value in ASP.NET Core Generator.

* Updated PetStore samples
2017-12-13 00:13:13 +08:00
Aleksandr Nekrasov
643ef64f04 resteasy support javax injection instead of static delegate factory (#5272)
* resteasy support javax injection instead of static delegate factory

* fixed resteasy joda example
2017-12-12 00:35:51 +08:00
Max K
d881cb39bf Added Base Path support as well as PathParameterValidation (#7120)
* Ran bin/aspnetcore-petstore-server.sh

* Added BasePath filter and Validation filter

* Updated filters and added Attribute generators

* Removed newline

* Updated samples
2017-12-12 00:04:20 +08:00
Francis Lalonde
f49109c1f6 Match rust integer type to minimum and maximum constraints (#6985) 2017-12-10 11:19:28 +08:00
Ville Skyttä
794bb07cf7 Spelling fixes (#7142) 2017-12-10 10:48:30 +08:00
Dimitar Ivanov
b4f707450a Erlang server: handle broken JSON (#7129) 2017-12-09 17:57:48 +08:00
Krzysztof Karol
d43e9c8be2 Fix wrong params indentation (#7136) 2017-12-09 17:22:24 +08:00
Mads Føhns
2af8868281 Fixed #7137 by checking for Response before calling getBody() on it (#7138) 2017-12-09 17:20:56 +08:00
Benjamin Gill
1a831f73f3 [rust-server] Plaintext support; encode params (#7082)
* MMORCH-428: Export the Authorization struct

This is needed so that code can check that the version of Authorization
in the auto-generated code is the same as the version it is using. If
the versions are not exactly the same then the lookup into the TypeMap
will not work.

* Add Rust as a supported language for client and server.

Clarify that there are two Rust client implementations, and one Rust server implementation.

* Percent-encode path and query parameters in client URLs
Fixes #122

Also don't include a question mark at the end of the path when there are no query paramters.
Fixes #121

* Rust2 client: add --host and --port parameters to example client.

Allows the example command-line client to override the default host and port.

* Extract default host and port from Swagger file.

* Derive 'Eq' and 'Ord' on enums

* Rust2: improve server code structure.

    server.rs (main.rs) - main entry point for binary; starts the web server and points it at the server code within the library.
    server_lib/mod.rs (lib.rs) - root of library; creates the server.
    server_lib/server.rs (server.rs) - actual server code

The old server_lib/mod.rs is now server_lib/server.rs; server_lib/mod.rs is new.

This structure is easy to map onto a server implementation; unfortunately we can't get it exactly right here because of the limitations of cargo's examples/ folder.

* Rust2: Explain fully how to use the example code in your project.

* Added plaintext support

* Linting

* MGJ Markups
2017-12-08 18:42:14 +08:00
Oliver Hoffmann
20f48b04fc Make efficient use of entrySet iterator. (#7105) 2017-12-08 00:35:11 +08:00
Benjamin Gill
a57fb0c7db [rust-server] add license and description to Cargo.toml (#7080)
* Move errant file to 'rust-server'

Rust2 was the old name

* Add license and description to Cargo.toml

For rust-server, getting them from the swagger

* Valid Java doesn't have uninitialised variables...

* Default license to "Unlicense"

* Set license to "Unlicense" for generated crates
2017-12-08 00:28:29 +08:00
Luciano Jr
da942ab80c Update code style (#7127) 2017-12-08 00:25:28 +08:00
Jinkui Shi
01b6330202 [Scala] [ISSUE-7085] Scala template code format refactor (#7086)
* [Scala] [ISSUE-7085] Scala template code format refactor

* upgrade scala version to 2.11.12 and upgrade dependency version
2017-12-08 00:20:19 +08:00
Akihito Nakano
1ff3b00ac5 [PHP] Add generator version (#7124)
* Add generator version

* Update samples

- bin/php-petstore.sh
- bin/security/php-petstore.sh
2017-12-08 00:02:52 +08:00
Anton Antonov
2d56f247ce Fix typo (#7131) 2017-12-07 23:52:13 +08:00
topce
b0f61f394c fix issue 7048 (#7108) 2017-12-07 23:50:26 +08:00
Max K
e75523a684 [AspNetCore SERVER] Added support for ASP.NET Core 2.0 (#7114)
* Updated to .NET Core 2.0

* Fixed issue with IConfiguration vs. IConfigurationRoot

* Ran bin/aspnetcore-petstore-server.sh

* Updated to .NET Core 2.0

* Fixed issue with IConfiguration vs. IConfigurationRoot

* Ran bin/aspnetcore-petstore-server.sh
2017-12-06 11:02:13 +08:00
Jean-François Côté
40f1de8a58 [Typescript jQuery] Add README.md (#7113)
* Add README.md to the typescript jquery client generator

* Fix from code reviews about the addition of README.md. Made the fix in fetch too since it was a copy paste
2017-12-06 10:34:29 +08:00
Max K
645d71ed3b Operation now returns StatusCode Stubs as well (#7098)
* Operation now returns StatusCode Stubs as well

* Updated mustache file to use comments

return StatusCode(..) is now commented out.

* Change default(..) to not escape the type

default(dataType) --> default(&dataType)

* Return IActionResult no matter what..

* Updated formatting

* Ran bin/aspnetcore-petstore-server.sh
2017-12-05 22:14:00 +08:00
William Cheng
ffa0151445
fix msf4j return type annotation (#7110) 2017-12-05 17:23:04 +08:00
Sridhar-1987
a4fbbb5999 Pass optional as null (#7066)
* Pass optional as null

* Addressing review comments

* Addressing review comments-2

* Addressing review comments-3
2017-12-04 22:18:32 +08:00
Ramzi Maalej
61e706ba6f [Akka-Scala] Add build.sbt to Akka-scala (#7076)
* Add build.sbt to Akka-scala

* Add readme.md and build.sbt to petstore sample
2017-12-01 12:03:10 +08:00
ehyche
76d3cb5002 Swift4: Fix issue 6746 - problem with arrays of primitives (#7072)
* Update samples using latest codegen and templates

* Fix issue 6746 - problem with array models where array element type is a primitive
2017-12-01 10:30:24 +08:00
antihax
831e8d7c87 [Go] Add context to all requests for tracing, logging, cancellations, etc. (#6997)
* Add context to all requests for tracing, logging, cancellations, etc.

* Fix compile error with when call has no parameters.
2017-11-30 00:30:35 +08:00
William Cheng
5994a2fb2d
use {{{mediaType}} instead of {{mediaType}} (#7073) 2017-11-29 16:17:51 +08:00
yelhouti
ce11e035d8 fix spring cloud config variable names (#7068)
remove leading space
2017-11-29 11:05:03 +08:00
Sergey Shoshin
adda792010 #7026 [Swift] tvos support added (#7034) 2017-11-28 12:23:23 +08:00
Tomasz Prus
efe16fda8c [python/tornado] ssl improvements (#7061) 2017-11-28 10:06:29 +08:00
demtnt
dca7a1507b As per documentation https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/bind/annotation/RequestPart.html @RequestParam should be used instead of @requestpart if not file. (#6861) 2017-11-27 22:06:37 +08:00
Ben Mordue
02bcc55e23 Do not apply content-type header if no request body (#6648)
* Do not apply content-type header if no request body

* Set content-type header if there are form params

* Add tests

* Run update script

* Regenerated sample clients
2017-11-27 18:33:28 +08:00
Maxim Zinchenko
a8642dbdfc [Java][Spring][Server] Issue #4680 (#6890)
* Issue #4680 correct values for enum with escaped double quotes

* Issue #4680 regenerate samples

* Issue #4680 remove new lines

* Issue #4680 fixed scripts

* Issue #4680 update samples under CentOS
2017-11-27 18:30:39 +08:00
Greg Marzouka
75c2d5ed4c [Scala] Default Option parameters to None (#6538)
* Add sensible defaults for not required params in scala

* Also default to None for async methods
2017-11-27 17:06:28 +08:00
Ramzi Maalej
0c3c4ccf82 Use maven plugin to set required maven version (#7032) 2017-11-27 16:59:14 +08:00
craffael
fc5ec6271a [NancyFx] Fix for issue #7024, date field mapped to ZonedDateTime (#7025)
* add support for async routes/endpoints

you can now set --optional-properties async=true to generate
a nancyfx server stub that uses asynchronous programming.

(cherry picked from commit 126869cb0b967e8063417e11993cf6326ce8ffd4)

* add nancyfx-petstore-server-async.sh to generate sample of async nancyfx.

* Rename async => asyncServer

* update bin/nancyfx-petstore-server-async.sh

* rename async => asyncServer in api.mustache + small bugfix

* run ./bin/nancyfx-petstore-server.sh and ./bin/nancyfx-petstore-server-async.sh

* remove additional new line in api.mustache + add space after if

* run ./bin/nancyfx-petstore-server.sh and ./bin/nancyfx-petstore-server-async.sh

* Map `date` fields to LocalDate c# type + add a JsonConverter for LocalDate.
2017-11-27 16:46:09 +08:00
Erik Janssen
1b90a05754 [Scala][Finch] Adding security definitions to Finch (#6891)
* #6818: support for security definitions and some refactoring

* adding support for Either

* adding dates with TimeZone (date-time) and Local (date)

* cleanup

* generating code
2017-11-27 16:38:12 +08:00
naelrashdeen
5d59dd10ec [PHP][Symfony] Further enhancements (#7001)
* Further enchancements for PHP-Symfony. Fixes issues described in #6999

* Ran shell script to update petstore sample
2017-11-27 16:25:50 +08:00
Gingonic
a565a94a06 Removed wrong import of StrictJsonDeserializationVisitor (#6948)
* Removed wrong import

* Run samples
2017-11-27 16:16:42 +08:00
Tristan Sloughter
3d3a30a533 [Erlang] erlang client: properly handle optional parameters (#7042)
* erlang client: properly handle optional parameters

* [Erlang Client] handle multiple path params in the same path
2017-11-27 16:11:14 +08:00
topce
8a0de971e4 Remove rxjs operators (#6989)
* do not import rxjs-operators if using HttpClinet

* generate code

* do not import operators if they are not needed
2017-11-24 13:24:46 +08:00
Keni Steward
8eb33f9d1b [Typescript][Angular]Issue #6902 Return Client Response for Angular 4.3 and above with Observe string (#6955)
* Updated swagger-ui wget url to https

* Issue #6902 Add Observe/ReportProgress pass through variables to the response for each api call for angular 4.3 and above

* Issue #6902 Fixed problem where extra comma as generated and should
not have been.

* Issue #6902 Fixed compiltion issue for Angular 4.3
2017-11-24 01:50:07 +08:00
William Cheng
a4531b695e
use python client toOperationId logic (#7035) 2017-11-23 17:41:50 +08:00
Oliver Hoffmann
10107ac7ec Upgrade to resteasy-jackson2-provider (#7017)
* Upgrade to resteasy-jackson2-provider

* Upgrade to resteasy-jackson2-provider
2017-11-23 17:35:49 +08:00
Ramzi Maalej
ebfdc05199 [Akka-Scala] Add readme file (#7027)
* Add readme file

* Add readme file to Scala generator
2017-11-23 16:46:35 +08:00
Ken Geis
5ea3499188 fix swager typo (#7028) 2017-11-23 12:03:52 +08:00
Lukasz Konopski
0f92baeb04 Inheritance support java client okhttp gson (#6636)
* #6636 inheritance support for java client okhttp with gson parser

* #6636 generate samples
2017-11-22 21:28:13 +08:00
Guillermo Pastor
65bb761952 Fix: Resolve problem with UUID class not found if there is almost one parameter with format as uuid (#6617)
* feat: java.util.UUID if parameter is UUID

* solve git problem
2017-11-22 16:54:11 +08:00
François Rosé
acefe3f385 [CppRest] Add Object and fix modelbase includes (#6905)
* Objects are represented by `ModelBase.h`, not `Object.h` which does not exist.

* Use correct relative imports for files in the `model` and `api` folders.

* [CppRest] Update cpprest petstore client sample.

* Implement `Object` class to support arbitrary types.

* [CppRest] Update cpprest petstore client sample.

* [CppRest] Add newly generated files to petstore client sample.

* [CppRest] Add `Object` to CMakeLists.
2017-11-22 12:19:13 +08:00
François Rosé
d9cea0f97e [CppRest] Support optional parameters (#6959)
* Use boost::optional for parameters that are not required.

* Update sample petstore client.
2017-11-22 12:13:05 +08:00
William Cheng
803f337d24
[Scala][Lagom] rename generator from scala-lagom to scala-lagom-server (#7014)
* rename scala-lagom to scala-lagom-server

* add back pom.xml and shell script

* update scala-lagom-server path in circleci pom.xml

* make shell script executable

* rename batch file
2017-11-21 23:24:02 +08:00
William Cheng
573b5518be
[Scala][Lagom] minor enhancements (#7011)
* rename lagom scala, minor enhancements

* add scala lagom to circle ci

* test sala lagom with jdk8 only
2017-11-21 17:34:09 +08:00
gmkumar2005
32abb72769 [LagomScala] Add Scala API generator for lagomframework #6900 (#6901)
* Initial Commit

* Removed unneeded class, Updated names as per naming conventions, Removed licensing info from  generated code

* Moved samples from client folder to server

* Fixed naming issue with scripts in the bin

* improved code format for api

* fixed compile issue and improved formatting

* fixed compile issue and improved formatting
2017-11-21 15:40:04 +08:00
Kenny Jones
63fce58931 [Java][Spring] Resolve serialization warning from RFC3339DateFormat (#6960)
Adds `serialVersionUID` to RFC3339DateFormat.java to avoid Java warning.
2017-11-21 12:14:02 +08:00
Daiki Matsudate
a5e4abe5ec [Swift4]Update templates for swift 4 (#6921)
* update versions of dependencies on swift4 and swift3

* change syntax for swift4

* run petstore script

* change enum case from UpperCamel to lowerCamel

* remove unneeded break statements

* avoid wrapping conditionals in parentheses

* avoid force casting

* run pod update on petstore/swift4/rxswift

* update project for swift 4

* run swift4-petstore-all.sh

* fix compile error

* avoid use iso8601 date strategy for encoder / decoder

* resolve file references
2017-11-21 11:33:52 +08:00
manuc66
b06ccec11e [csharp] Update JsonSubTypes to 1.1.3 and use nuget dependency (#6969)
* the result I want to obtain

* add csharp-petstore-net-40.bat for windows

* just ran bin\windows\csharp-petstore-all.bat

* Removed those directories:
- samples\client\petstore\csharp
- samples\client\petstore\csharp-dotnet2

then ran :
bin\windows\csharp-petstore-all.bat

* - update JsonSubTypes to 1.1.3 by using nuget dependency (the package is compatible with net40)
- allign all version of Newtonsoft.Json to 10.0.3

* the result of bin\windows\csharp-petstore-all.bat

* ran bin\security\windows\csharp-petstore.bat
2017-11-21 11:26:58 +08:00
topce
04ee374328 [TypeScript][Angular] fix problem with strict compilation (#6978)
* fix probelme with strict compilation

* commit generated files
2017-11-21 01:21:45 +08:00
JacC510
181680b0af - fix duplicate problem (#6981)
* - fix duplicate problem

* style guide adjustment

* replace tab with 4-space

* replace tab with 4 -space
2017-11-21 00:42:19 +08:00
Peter Stuart
79bac2ca04 Fix typo. (#6991) 2017-11-18 15:48:02 +08:00
Alex Goldring
9be12f9d03 Removed harmful content-type check (#6977)
https://github.com/swagger-api/swagger-codegen/issues/6226
2017-11-17 23:33:59 +08:00
William Cheng
15bbb52b22
check for dot in path and throw exception if found (#6986) 2017-11-17 20:18:06 +08:00