* Add overloads on signals.
The overload adds the NetworkError and the error string to the signal. Both signal will be emitted. Clients are supposed to subscribe to only one of the overloads.
* refactor generated code alignement
* Do not use method overload for signals. Instead, have another naming convention for signal that carries Error information.
Why ? Because signal overloading and QT5 connector with method referencing do not mix well (see http://stackoverflow.com/questions/16794695/connecting-overloaded-signals-and-slots-in-qt-5). It would need to specify exactly which overload to take. That is cumbersome to write AND is a breaking change for the consumer of the generated code.
* update qt5 sample files
* Added code to templates to ensure generation of code for Swift3 that builds on both Apple platforms and Linux. Fixed a bug in the Model decoders that prevented code from building for Linux
* Ran the script to generate the PetStore API
* [Erlang] Address apparent reproducibily issue of sample
Spotted running `bin/erlang-petstore-server.sh` on d08d55d41 .
Apart from newlines, this is the opposite change of ec6248cbc .
* [Erlang] Perform basic testing of sample server on CI
* [Erlang] Install recent Erlang/OTP version
... in order to satisfy `jesse` compilation.
The error I faced is:
```
$ curl -f -L -o ./rebar3 https://s3.amazonaws.com/rebar3/rebar3 && chmod +x ./rebar3 && ./rebar3 version && export PATH="${TRAVIS_BUILD_DIR}:$PATH"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 766k 100 766k 0 0 1041k 0 --:--:-- --:--:-- --:--:-- 1041k
rebar 3.3.6 on Erlang/OTP R16B03 Erts 5.10.4
...
===> Verifying dependencies...
===> Fetching jesse ({git,"https://github.com/for-GET/jesse.git",
{tag,"1.4.0"}})
===> Fetching jsx ({git,"https://github.com/talentdeficit/jsx.git",
{branch,"v2.8.0"}})
===> Skipping jsx (from {git,"git://github.com/talentdeficit/jsx.git",
{tag,"2.8.0"}}) as an app of the same name has already been fetched
===> Compiling jsx
===> Compiling jesse
===> Compiling _build/default/lib/jesse/src/jesse_tests_util.erl failed
_build/default/lib/jesse/src/jesse_tests_util.erl:28: can't find include lib "common_test/include/ct.hrl"
_build/default/lib/jesse/src/jesse_tests_util.erl:55: undefined macro 'config/2'
_build/default/lib/jesse/src/jesse_tests_util.erl:24: function do_test/2 undefined
_build/default/lib/jesse/src/jesse_tests_util.erl:72: function test_schema/3 is unused
_build/default/lib/jesse/src/jesse_tests_util.erl:102: function get_path/2 is unused
_build/default/lib/jesse/src/jesse_tests_util.erl:105: function load_schema/1 is unused
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:804)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:751)
at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:313)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (Erlang Test) on project ErlangServerTests: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
```
* [Erlang] Bump `jsx` dependency to latest stable version
* [Erlang] Disable sample server from CI until compilation works
The hasMore field of the global authMethods was broken due to sorting after
setting that field. The sort order for per-operation authMethods was not
guaranteed to be consistent across runs because it didn't do sorting. This
change fixes those issues by always sorting and setting the hasMore field
post-sort.
query_params is a list of tuple, so defined it as a list by
default instead of a dict.
This fix below issue on the client side.
Traceback (most recent call last):
File "test.py", line 13, in <module>
api_response = api_instance.seek("the")
File "python-client/swagger_client/apis/seek_api.py", line 168, in seek
(data) = self.seek_with_http_info(recherche, **kwargs)
File "python-client/swagger_client/apis/seek_api.py", line 245, in seek_with_http_info
collection_formats=collection_formats)
File "python-client/swagger_client/api_client.py", line 323, in call_api
_return_http_data_only, collection_formats, _preload_content, _request_timeout)
File "python-client/swagger_client/api_client.py", line 135, in __call_api
self.update_params_for_auth(header_params, query_params, auth_settings)
File "python-client/swagger_client/api_client.py", line 512, in update_params_for_auth
querys.append((auth_setting['key'], auth_setting['value']))
AttributeError: 'dict' object has no attribute 'append'
Signed-off-by: Gregory Herrero <gregory.herrero@gmail.com>
* add withCredentials to the configuration
1. `withCredentials` in Request is `false` default
2. if want to set the `withCredentials` as `true` (for CORS request),
instance `Configuration` object and set the `withCredentials` as `true`.
* simplify the code according to the code review
* remove trailing space in cpprest, update samples
* add android batch files, better code format, sync petstore.json with
petstore.yaml
* restore petstore.json and sync it to petstore.yaml
* update circleci pom.xml
* add new android files
* add new android files
* Elizabeth - changes to include swagger version in generated api files
* Filtering version.properties in swagger codegen module
* Removing resource filtering from swagger codegen cli module
* Merging master
* Converting to constructor based injection
* Correcting spelling mistake
* Adding the bean for ObjectMapper
* Adding files modified by running the petstore scripts
* Adding final qualifier to objectMapper variable in apiController mustache
* Add support to UUID type
* Simplify and use a simple QString instead of a QUuid.
Work for using a QUuid is way larger than supporting QString (imply modifying multiple c++ templates).
Current needs are fullfill with the use of a simple QString, so I let the use of QUuid for future enhancement.
* - add windows executable for generating qt5 security samples
- update sample clients
PS : some modifications on the samples are not related to the patch I applied. Were the samples up-to-date ?
* Fix NullPointerException for info.version on Javascript client codegen
* info version null check handled and default version/appVersion value set to 1.0.0
* Removed null check for info version. Fixed DefaultGenerator code to handle null check.
* semicolon added missing
* [JAVA/] jaxrs/jersey2 (Issue: 4662) Made java8-date codegeneration to work with jersey2
* Ran shellscripts for jaxrs-jersey-petstore-server and java8-petstore-jersey2 to update petstore samples
* Updated the Petstore samples
* This change uses std::stringstream for string conversions instead of std::to_string(). Android doesn't yet support std::to_string(). This should fix#4632
* Add support for Spring's RestTemplate in Java client codegen
Resolves#1176
* Update all Java samples to include change for Jackson enums
Currently enums are deserialized from a String value with an
explicit @JsonCreator. However, they are not being serialized with
this String value. This change introduces the @JsonValue annotation
on the toString() method of enums, so they will be serialized as a
String with the correct value.
* use py3 instead of py34
* fixed test to test invalid enum
* ADDED: assign variable in the ctor with property setter to check validity if possible. CHANGE: move required property check to proper place. CHANGE: remove double quotes from allowed_values for none-string enum property
* rebuilt samples
* comment for improvement
* ADDED: post process enum model for python.
* comment
* rebuilt samples
* rebuilt samples
The generation code was ignoring top-level aliases for any language config that
contained "java", which included "javascript", a completely different language.
Changed this to be those configs based on the JavaAbstractGenerator class.
When a spec defines a Model at the top level that is a non-aggretate type (such
as string, number or boolean), it essentially represents an alias for the simple
type. For example, the following spec snippet creates an alias of the boolean
type that for all intents and purposes acts just like a regular boolean.
definitions:
JustABoolean:
type: boolean
This can be modeled in some languages through built-in mechanisms, such as
typedefs in C++. Java, however, just not have a clean way of representing this.
This change introduces an internal mechanism for representing aliases. It
maintains a map in DefaultCodegen that tracks these types of definitions, and
wherever it sees the "JustABoolean" type in the spec, it generates code that
uses the built-in "Boolean" instead.
This functionality currenlty only applies to Java, but could be extended to
other languages later.
The change adds a few examples of this to the fake endpoint spec for testing,
which means all of the samples change as well.
* Fixed classFilename in typescript-angular and recreated samples
* Changed classname to classFilename in ts-angular2/models.mustache
Also recreated ts-angular2 sample
* Adds Valid annotation for request body (#4847)
If useBeanValidation is active, this change will add Valid annotation to ReqeustBody
* Adds generated samples for bean vaildation in spring boot (#4847)
* Adds Valid import to Controller
* Adds generated code for bean validation change
Commit e3d04ee01 (issue #5240) introduced unsafe add/put methods for optional
list/map parameters. This change maintains the spirit of issue #5240 (optional
containers are null by default) while still making add/put calls safe. It does
this by checking for null first and, if so, initializing it with an empty
container.
Also updated the affected samples using the various scripts in bin/.
* set list to null in java if not required
* update petstore sample for java server stub
* update sample for msf4j
* add null assignment to new list/map in java
* First commit of the Java Play Framework server generator. It is highly based on Spring so there might me a couple of things that don't make sense (like options or parameters) for the Play Framework.
* Fix suggestions in the PR discussion + add .bat and .sh file as requested.
* Updated Readme.md file
* Remove unused mustache file + fix baseName vs paramName in all the mustache files.
* Fix the compilation error when we have a body which is a list or map. Doesn't fix the problem with the annotation itself.
* Fix the problem with the Http.MultipartFormData.FilePart
* Return a FileInputStream when the returnType is "file" + Fix a couple of other bugs with boolean + updated sample
* Return an InputStream instead of FileInputStream (except in the instantiation)
* A little cleanup for the form param of type file.
This is for the EAP version specifically.
* The JacksonConfig class always used the io.swagger.api package
* The RestApplication class did not import the service implementations
from the correct package
* Added shell script for generating test applications
* [Swift3] Fix bug where non-camel-case path params didn't work.
* [Swift3] Fix bug where int enums generated non-compiling code. Swift3 integration tests now pass.
* [Swift3] Add a non-camel-case path parameter to petstore-with-fake-endpoints-models-for-testing. This would have caused the Swift3 tests to be broken before 7387e49fef56a624045aa52b65ffb9c19b3853ec.
* Support Swagger collectionFormat encodings in Feign
Feign only natively supports the "multi" collectionFormat for encoding lists
of parameter values. This change adds manual encoding of the other formats, such
as "csv" (the default for collections), "tsv", space-separated, and pipes.
* Fix typo in anchor tag.
* [#5172] Allow vendor json media types
* Revert unnecessary diffs
* Update petstore sample
* Didn't run mvn after some edits
* Rerun ' ./bin/java-petstore-all.sh' and './bin/security/java-petstore-okhttp-gson.sh'
* Added more realistic test cases for isJsonMime
* JaxRS server: set serverPort only when not given from outside.
* Update JaxRS sample creator scripts to fix serverPort.
* Preliminary test fix for JaxRS server generators.
* Updating samples for JaxRS with Jersey1/2.
This change enables top level enumeratons to be written out as:
export type SortDirection = "Ascending" | "Descending";
vs.
export class SortDirection {
}
* Pretty-print swagger.json.
(This was done via `jq`. In a later commit we'll generate it pretty-printed.)
* Erlang Server: pretty-print generated swagger.json.
* Update samples for Erlang-server.
* Issue #3084: add hideGenerationTimestamp option to Go server generator.
* Issue #3084: use hideGenerationTimestamp in go server sample script.
* Update Go server samples.
* [JAXRS-CXF][#4776] Respect query params default values in generated interfaces
Before this change, the generated interface ignored default values of query
params. Now, it adds the proper @DefaultValue annotation.
See issue #4776 for example.
* [JAXRS-CXF] Update samples
* First commit of the Java Play Framework server generator. It is highly based on Spring so there might me a couple of things that don't make sense (like options or parameters) for the Play Framework.
* Fix suggestions in the PR discussion + add .bat and .sh file as requested.
* Updated Readme.md file
* Remove unused mustache file + fix baseName vs paramName in all the mustache files.
* Fix the compilation error when we have a body which is a list or map. Doesn't fix the problem with the annotation itself.
* Fix the problem with the Http.MultipartFormData.FilePart
* - Add "wrapCalls" and "useSwaggerUI" CLI Options and updated what handleException does to follow Play Framework lifecycle more closely
- Updated all mustache files accordingly
- Updated the sample
- Updates Play Framework version to the latest 2.5.13
In the convenience class defined for generating a Map of query parameters, the
parameter name was mistakenly being set to the Java variable name, not the
actual parameter name. These are often the same, but can be different in the
case of multi-word parameters, such as in the sample API's `enum_query_string`
vs `enumQueryString`.
* Sync with upstream/master
* Support Markdown in -l html
Add https://github.com/atlassian/commonmark-java to modules/swagger-codegen to convert Markdown to HTML,
update StaticHtmlGenerator to use this (see the toHeml() method and its uses)
Add a new test case bin/html-markdown.sh and
modules/swagger-codegen/src/test/resources/2_0/markdown.yaml
* Support Markdown in -l html
Add https://github.com/atlassian/commonmark-java to modules/swagger-codegen to convert Markdown to HTML,
update StaticHtmlGenerator to use this (see the toHeml() method and its uses)
Add a new test case bin/html-markdown.sh and
modules/swagger-codegen/src/test/resources/2_0/markdown.yaml
* use builder pattern for operations
* @QueryMap parameter only for query parameters
The previous iteration had replaced all parameters (body, path, query, etc)
within a single @QueryMap. But Feign only supports this style of parameter
passing for query parameters. Besides, for the case of a body parameter (like
soxhlet uses) it only added extra verbosity. With this change, the query
parameters are gathered together in a single @QueryMap and the other parameters
are left alone.
* Adding template for generating test code
* Make javadoc consistent with rest of file's conventions/indents
* Update samples
The files in src/main were generated by running
$ bin/java-petstore-feign.sh
The files in src/test were manually fixed.
* Correct capitalization of @QueryMap class in feign
Adds a field operationIdCamelCase (a la operationIdLowerCase) to the
CodegenOperation container and uses it in the feign-generated classes
with @QueryMap parameters. Also re-generated the feign samples.
* Adding hyphen to javadocs for extra readability.
* Adding (not replacing) api method with @QueryParam overload.
In order to keep backwards compatibility, switched to adding a new method to
the interface instead of replacing the old call.
* Adding newline to generated source for readability.
* First commit of the Java Play Framework server generator. It is highly based on Spring so there might me a couple of things that don't make sense (like options or parameters) for the Play Framework.
* Fix suggestions in the PR discussion + add .bat and .sh file as requested.
* Updated Readme.md file
* Remove unused mustache file + fix baseName vs paramName in all the mustache files.
* Add an CLI option to generate interface. These interfaces are implemented by the controllerImp and help to generate the code with an IDE like IntelliJ because on updates of the code the controllerImp must follow the contract of the interface. If it don't, IDE will provide support to generate missing functions or parameters. I also did some cleanup of options we don't use in Play Framework.
* Fix the compilation error when we have a body which is a list or map. Doesn't fix the problem with the annotation itself.
* Fix the problem with the Http.MultipartFormData.FilePart
* Small fixes
* Remove everything related to swagger-play. No need for annotation anymore because we export the swagger.json directly and show the documentation using swagger-ui with the direct path. Also added the sample.
* Remove/Rename paramsX mustache because there is no more documentation. Remove unused file. updated sample
* Fix the problem with default values that was not set correctly.
* Small fix related to bad merging
* Add handleException CLI options
* Fix default values once and for all!
* Update sample files + fix bug
* Fix bug with body that is required and have a list as a parameter + add bean import for interface to prevent compilation error
* added supporting files for Dockerfile and dockerignore generation for python-flask lang
* documenting how to build the docker image and how to spin up a container
* updating pet store sample
* fix#2159 dataformatter error for iOS Swift
When trying to parse 24-hour time to 12-hour time, date formatter throws fatal error.
It's caused by lack of settings locale for date formatter.
* update sample code
* #4627 - When looking for template files also look in the libraries subfolder of the supplied templateFolder, before checking the embedded locations.
* Reworked the order in which template files are searched for:
- 1st the code will check if there's a <template folder>/libraries/<library> folder containing the file
- 2nd it will check for the file in the specified <template folder> folder
- 3rd it will check if there's an <embedded template>/libraries/<library> folder containing the file
- 4th and last it will assume the file is in <embedded template> folder.
Added unit test to test template dir overloading.
* [CsharpNetStandard] Added C# .NET Standard Client Generation
Added language CsharpNetStandard.
Everything copied from csharp Client Generator.
Dependancies switched from Restsharp to Restsharp.Portable.
Changes made where nececary to replicate Restsharp functionallity.
Project type changed to .NET Standard protable library.
* [CsharpNetStandard] Removed client prop validation due to incompability
* [CsharpNetStandard] Minor fixes
Changed leftover RestSharp.Method to Method
Changed to .Net Standard 1.3 for compability reasons
Changed excludeTests to default to true due to tests not being implemented yet
Removed unnecessary targetFramework property
Removed leftover UWP stuff
* [CsharpNetStandard] More fixes
Added correct dependencies to Readme
Added correct supported frameworks to Readme
Added slightly better placeholder for installation instructions in Readme
Removed leftover dependencies from project.json
Removed leftover SupportsAsync stuff
Removed references to build.bat/-.sh since they're not yet being generated
Todo implement test generation
* [CsharpNetStandard] Added forgoten git_push.sh
* [C#-netstandard] Renamed option to csharp-netstandard
Also added .bat file for test generation
* [C# Net Standard] fixed path in .bat file
* [C# NET Standard] fixes to enum generation
Fixed issues with enum generation due to tired programmer
* [C# NET Standard] Generated sample client library
Sample library generated
Fixes:
Class actually works again
.bat - minor inconsistency fixed
* [C# NET Standard] Error corrected in how timeout is set
Configuration Timeout property changed to TimeSpan type and code corrected around that
* [C#] Merged .NET Standard generator into csharp generator
Functionallity of csharp-netstarndard generator has been moved into standard csharp generator under the targetFramework option as "v5.0"
This was previously missing and I don't think it was intentional.
It appears that swagger-codegen is already correctly processing
the yaml and the placeholder in the template was the only thing
missing.
* Swift3 enum: number variable names fix
Swift3 generator: added 'number' prefix to enum variable names that start with a number
* Fixed Swift3 enum variable names starting with number (prefixed with '_') and added test cases
* Swift3 enum var names: made sure to keep the next word after a number in lower case
* Update samples for nodejs + nodejs-google-cloud-functions.
* Fix example generator to use deterministic randomness.
This avoids changing results after each generation, and makes diff reviews easier.
* Update NodeJS samples.
This is the last "randomness" update. From now on the samples should only change if either the generator, the input or parameters change.
* Fix (partially) #4898 for groovy.
This also adds some TODOs for the missing path, form and body parameters.
* Update Groovy samples (after partial fix for #4898)