* - Added Restbed Generator
* - Added Json processing functions to model
- Removed unnused code from restbed codegen class
- Added response header processing to api template
* Changed it to respect alphabetical order
* Made the string joining java 7 compatible
* Added 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
* Removal of warning (final) and fix of a missing default value for boolean query parameters
* 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
* Fix the conversion of boolean type
* Add samples for the fix with the boolean
* Fix bugs introduced by polci related to the bean validation.
* Refactor to use the "beanValidationCore". Asked by @wing328
* [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
This is the result of
- `$ git checkout master`
- `$ bin/run-all-petstore`
No change was made to the code, just ran the aggregate sample generation
script.
* 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
* Rewrite of Go Client
* Revert to older version of context.Context
* Clean and bulk up concurrency test.
* Correct {{path}} to {{{path}}}
* change custom date type to string.
* Add APIKey authentication
* Correct missing line from resolving conflicts.
Correct missing line from resolving conflicts.
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.
* 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
* Migrate from Swashbuckle to Swashbuckle.AspNetCore
* Fix typo
* Add SwaggerResponse for all responses
* Remove model constructor
* Add required attribute if available
* Improve whitespace and remove some redundant code
* Remove redundant code from Dockerfile
* Add disable warning 1591 pragma for model utility methods for bringing down compiler warnings to zero
* Add proper model state validation before controller is called
* Regenerate AspNetCore PetStore sample
* Updating samples after #5232.
* Fix tests after #5232.
* Fix Javascript client tests.
* 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.
* Updating JaxRS samples again.
* 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.
* 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.
* 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
* 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
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.
* 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.
* Make java spring controller constructor public.
This lets users manually create the controller and inject the delegate in the
spring configuration file, instead of letting spring scan for controllers and
autowire the delegate.
* Ran spring-all-pestore.sh.
* Update samples for Scalatra after 2.2.2.
* [scalatra] Revert changes to build.sbt
Changes were made in conjunction with the new finch generator. This
reverts those changes to Scalatra's previous build.sbt.
* Update scalatra samples again after revert of part of #3905.
* Improved ExampleGenerator:
- Now takes into account enum and uri/url formats for strings.
- Uses example for referenced objects if available.
- Proper examples get generated for specific numeric formats, because more specific formats now get checked before generic format.
- Honors min and max values for numerical properties, if set.
* Ran script `bin/nodejs-petstore-server.sh`.
* Renamed log to logger to conform to coding standard.
* Update spring samples with current code.
This is done so I can see my own changes better.
* Regenerate samples after 2.2.2.
* use baseName instead of paramName for spring annotations.
* update spring petstore samples to show the effects.
* jaxrs-cxf: Re-added usage of contextPath in api.mustache (basePath)
* jaxrs-cxf: Added useAnnotatedBasePath and generateNonSpringApplication flags
* useAnnotatedBasePath=true uses the @Path annotation in the generated interface to set the basePath, default is false
* generateNonSpringApplication=true generates a web.xml with CXFNonSpringJaxrsServlets. If useAnnotatedBasePath=true only one servlet will be created, otherwise one for each API
* jaxrs-cxf generateNonSpringApplication: removed creation of multiple servlets
Multiple servlets were generated if useAnnotatedBasePath was false.
This is not necessary as there is only ONE basePath per contract
* jaxrs-cxf: added sample generation for useAnnotatedBasePath and generateNonSpringApplication
* Issue #4606 (Spring) SubClass annotations are missing from the base class
* Issue #4606 (Spring) SubClass annotations are missing from the base class
* Commit updated samples from ./bin/spring-all-pestore.sh
* [JAXRS-CXF] [issue #4386] add builder-style methods to model classes
before this change, model classes had only a default constructor and
setter methods, resulting in code like this:
myModel = MyModel();
myModel.setFirstField(firstField);
myModel.setSecondField(secondField);
return myModel;
this change adds builder style methods, such that the above code can be
written more compactly:
return MyModel().firstField(firstField).secondField(secondField);
this is consistent with other JAVA generators in swagger-codegen.
* update jaxrs-cxf sample code
* Feature/objc tasks 2.3.0 (#3522)
* change api and ApiClient to return cancellable NSURLSessionTasks instead of NSNumber
* define a configuration protocol for custom configurations, which can be passed to api clients instead of a global configuration, provide a default implementation with a singleton option
* integrate a workaround for a current JSONModel concurrency bug
* update to new ISO8601 pod
* add missing call to super
* integrate new templates into codegen
* updates documentation templates
* updates petstore objc generated code
* fixes objc client tests
* [ObjC] Add version define and share default headers of each client
* add finch generator and resource
* update license, add errros
* Fix problem with multitheard api client
* fix some errors for finch
* [finch] Remove license header
* [finch] Remove finatra stuff, fix a few issues
* WIP: Finch server generator
* [finch] WIP: server generator impl
This puts parameters (input/output) in the right format. Currently, this
is done in the generator class using vendorExtensions, but should be
refactored to imported templates to clean up.
Previous commits of the server generator output to appropriate
models/api directories. I've made no changes to this logic, but code
currently generates to the root scala package directory. This will need
to be fixed.
There's also an issue with circe's and Option[Date] in the Order type.
This issue will need to be resolved. As well, there's some unused
imports to clean up.
Initial implementation lacks support for custom imports, type mappings,
etc.
* [finch] Update api/model package and imports
* [finch] Explicit import/type mappings
* [finch] Regenerate example
* [aspnetcore] Use default rather than null in ctor
See original issue #3608
This adds same model constructor logic to aspnetcore as what was added
to csharp generator by PR #4145.
This doesn't include NancyFX because model construction relies more on
object initialization in that generator.
* [aspnetcore] ctor defaults + enum support
This follows up to #4145, and modifies model constructors to use
default(x) instead of initializing to nulls. default(x) works in all
cases using intuitive default values it is intended to support.
Example:
csharp> public enum Color { RED = -1, BLUE = 0, GREEN }
csharp> var color = default(Color)
csharp> color
BLUE
In the above example, The default of BLUE=0 is expected. For nullable
enums, this would be null as a default.
The aspnetcore generated code is also updated to support enums and
nested enums to account for changed to the petstore.yaml used to
generate the sample.
* [aspnetcore] Regenerate sample
* fixes#4432 Adding support for the modifier within the Jaxb XMLElement annotation. Updated README with JaxbAnnotations configuration option.
* #4432 Running the Petstore files
When a string enumeration has the empty string as one of its available
values, the generated code for many languages is invalid because the
empty string can not be used as an identifier. As with numbers and
symbols, provide a mapping to an English name which can be used as a
replacement. In this case, "empty" for the empty string/empty value.
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
* Another approach: extending NodeJS server to support GCF.
This does not add a new language, but adding some client options
to support Google Cloud Functions (GCF).
* Add URLs for how to deploy the generated code.
Adds the client options help message and the README.md file.
* [JaxRS-CXF][bug #4330] support containers in return types
before this commit if a method returned a container (List or Map) of
THING (i.e. List<THING> or Map<String, THING>) the generated return type would
drop the container and only leave THING.
this commit fixes this issue such that the container type is properly
generated.
* regenerate jaxrs-cxf petstore sample
* add json annotations
* add cli flag to check for jaxb annotations
* add CLI-flag for switching Spring-XML or annotation config #4088
* add cli flag for generating jboss depl. descriptor #4088
* add JbossFeature CLI flag to Resteasy #4088
* update/add tests #4088
* cleanup tabs #4088
* improve api formatting #4088
* refine formatting #4088
* refine formatting again #4088
* add separate CLI-flags for controlling junit test features #4088
* add json annotations
* add cli flag to check for jaxb annotations
* add CLI-flag for switching Spring-XML or annotation config #4088
* add cli flag for generating jboss depl. descriptor #4088
* add JbossFeature CLI flag to Resteasy #4088
* update/add tests #4088
* cleanup tabs #4088
* improve api formatting #4088
* refine formatting #4088
* refine formatting again #4088
* add separate CLI-flags for controlling junit test features #4088
* add check for void methods + assertNotNull(response) #4088
* add spaces for @Produces #4088
* allow build with no web.xml config #4088
* comment invocations of tests #4088
* update petstore sample jaxrs-cxf server with gen/java first #4088
* re-generate jaxrs-cxf with src/gen/java #4088
* add client jaxrs-cxf #4088
* add switch to load SwaggerUI automatically #4088
* update to CXF 3.1.8 including supportSwaggerUi flag #4088
* update to cxf 3.1.8 and swagger-core 1.5.10 #4088
* update generated petstore for jaxrs-cxf #4088
* change Spring Boot urls to root #4088
* fix spring xml config #4088
* fix external enum usage for jaxrs-cxf #4160
* cleanup jaxrs-annotations in impl class
* fix handling of multiparts #4088
* fix @Min/@Max comments in beanValidationQueryParams #4088
* add swagger-codegen-ignore file+add src/test/resources #4088
* add cli-flag for produces/consumes json in api #4088
* add test case for outerEnum #4160
* remove php apache license
* remove license in sample code, update nodejs to use unlicnese
* remove license from jaxrs generator
* remove license from server generator
* update pom.xml for jaxrs resteasy joda server
* [feign] add threetenbp support for feign clients
* [okhttp] add threetenbp support for okhttp clients
* [jersey] add threetenbp support for jersey clients
* [retrofit2] add threetenbp support for retrofit2 clients
* [spring] add threetenbp support for spring generators
* add a workaround in tests for a bug in the petstore
The petstore doesn't manage fractional digits of dates correctly when there are less than 3
* Added switch to config to toggle use of yaml base path as module paths
* NancyFX template updated to return collections as array to allow framework to find views by type name for text/html mime type
* Added some more parser fixes for NancyFX
* Refactored collection parsers in Parameters.cs and changed some to return nullable collections to match the parameter mappings in AbstractCSharpCodegen
* re-ran petstore build
* fix NancyFX string parser
parser needs to access the Value parameter to enable the direct cast at line 102 when handling string parameters
* Updated nancyfx sample
* Added switch to config to toggle use of yaml base path as module paths
* fix NancyFX string parser
parser needs to access the Value parameter to enable the direct cast at line 102 when handling string parameters
* Updated nancyfx sample
This moves previous aspnet5 functionality to aspnetcore, aspnet5 now
derives from the aspnetcore generator and logs a warning that it's
deprecated.
This will help resolve any confusion because ASP.NET 5 is terminology
referring to the project of around a year ago. ASP.NET Core 1.0 is the
new name for the technology, and further enhancements should target .NET
Core 1.0 rather than any old vNext or preview stuff.