Commit Graph

9905 Commits

Author SHA1 Message Date
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
Euan Kemp
3029b7b0fb [Rust] Format example with rustfmt (#7339)
This was handled via 'cargo fmt' on the current nightly rust. I also
moved a few lines around and deleted an old comment.
2018-01-14 18:03:12 +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
Akihito Nakano
809e1f4c93 [PHP] Cleanup tests (#7333)
* Regenerate test/UserApiTest.php

The same implementation as testLoginUser() is in tests/UserApiTest.php

* Delete test/Client/ObjectSerializerTest.php

The same implementation is in tests/ObjectSerializerTest.php

* Update Petstore sample

- bin/php-petstore.sh
- bin/security/php-petstore.sh
2018-01-14 17:47:08 +08:00
William Cheng
094f69bc9e
fix missing "`", removed duplicated Huawei entries 2018-01-14 17:44:46 +08:00
wing328
2c628aa587 Merge branch '2.4.0' of https://github.com/swagger-api/swagger-codegen into 2.4.0 2018-01-14 17:41:37 +08:00
Darío Hereñú
94746bb23d Typo
on @266. Plus minor fixes (proposal)
2018-01-14 17:41:21 +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
fb73b8c4de update r petstore samples 2018-01-14 17:18:40 +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
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
wing328
714b94d96c v2.3.1 release 2018-01-13 15:42:56 +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
qct
acf70d0481 add swagger example to README.md (#7368) 2018-01-11 23:03:36 +08:00
wing328
50b599719d add tests for java vertx petstore 2018-01-11 16:36:23 +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
William Cheng
e679254158
add link to Sumit Maingi blog post 2018-01-10 12:00:37 +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
wing328
16e3226c8a Merge remote-tracking branch 'origin/master' into 2.4.0 2018-01-08 18:01:20 +08:00
Euan Kemp
26a665c771 [Rust] Recommend style based on 'rustfmt' defaults (#7335)
Rustfmt is widely accepted in the rust community. The actual style it
enforces is not completely stable, but running a reasonably recent
rustfmt and reading the short rfc-based style guide seems better than
nothing by a long shot.
2018-01-08 10:56:01 +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
8348d535ab Merge branch 'ehyche-ehyche_update_reserved_words_swift4' into 2.4.0 2018-01-08 00:14:17 +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
wing328
f9105c8bdc deploy snapshot version 2.3.1 2018-01-07 18:47:24 +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
William Cheng
743bc650ab add shijinkui to scala technical committee 2018-01-07 18:12:55 +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