* [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
* 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
* #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.
* 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
* 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
* 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
* Ran bin/aspnetcore-petstore-server.sh
* Added contact information to startup.cs
* updated to support NAME as well
* updated samples
* updated NAME default
* Updated Codegenerator as well as added new swagger-original mustache template
* updated Startup.cs template to provide guidance for original Swagger file
* Updated Sample
* 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
* 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
* 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
* 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
* 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
* 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.
* #6818: support for security definitions and some refactoring
* adding support for Either
* adding dates with TimeZone (date-time) and Local (date)
* cleanup
* generating code
* 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
* The get method template is modified to return the value of the enum instead of the enum itself.
* Update of the Petstore CXF server sample
* Update of the Petstore CXF client sample
* Update of the Petstore CXF server annotated base path sample
* Update of the Petstore CXF server non spring application sample
`unicode` does not exist in py3, therefore since six is already imported
switch to using `six.u` so that `unicode` is used on py2 and `str` is used
on py3.
The linting results for the generated samples are as follows
where the first number is the BEFORE and the second is AFTER.
pyclient 7714 vs. 120
pyclient3 7717 vs. 120
pyclient3-asyncio 7584 vs. 120
pyclient-tornado 7633 vs. 120
pyclient3-tornado 7633 vs. 120
For the complete details please see the following gist.
https://gist.github.com/kenjones-cisco/2eb69a7e8db75e9fd53789f01570d9f2
Enforces linting for python clients by running flake8 for the generated
python client.
* 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
* [Rust] Use serde Value for objects
This hopefully fixes the previous TODO; it at least fixes compilation
errors for the specific swagger model I'm working with.
* [Rust] Update Cargo.toml to specify versions
Letting the version float freely is scary, to say the least.
This gives it a better chance at being future-proof.
When the crate author had a recommended selector I picked that,
otherwise I went semver compatible.
* [Rust] Regenerate the example
* Add configuration to split input and output bean validations. When useBeanValidation is used, the variable are created in the application.conf file and can be tweaked by environment. For example, dev and stage can have true to both but only have input in prod.
* Refactor of mustache tags for more clarity
* sample generation with refactor
* Fix a couple of bugs with the fake-endpoint yaml but there is still 2 cases where it doesn't work.
* Remove Accept request header from api signature
* Inject HttpServletRequest to get request header and clean templates
* Use constructor injection for HttpServletRequest
* Implement example in default controller responses
The linting results for the generated samples are as follows
where the first number is the BEFORE and the second is AFTER.
flaskConnexion 1843 vs. 20
flaskConnexion-python2 1841 vs. 19
For the complete details please see the following gist.
https://gist.github.com/kenjones-cisco/edc9d71ef7fd2bf23714ecbb693d52b3
Enable the creation of the entrypoint so that the server can be started
using a named command instead of needing to always use `python -m` to
run the server.
* Removed commented code
* Input validation is now supported as strict JSON validation
* [PHP][Symfony] Improve the implementation
Closes#6614
* Generated code is tested to assure it compiles and updated README to dynamically load dependencies via composer
* Updated shell script because shippable tests were failing
* Inclusion of API documentation in CXF Server stub generation
* Inclusion of API documentation in CXF client generation
* Update of the Petstore CXF server sample
* Update of the Petstore CXF client sample
* Update of the Petstore CXF server annotated base path sample
* Update of the Petstore CXF server non spring application sample
* Changed {{{appDescription}}} to {{appDescription}} to use the HTML-escaped value in handling special characters like <, > in the description following the correction made by @wing328
* Update of the Petstore CXF samples
* Included Open Systems International in the list of companies using Swagger Codegen
* Force Jackson to use the real names of the properties of the Data type defined in the YAML
* Update of the Petstore CXF server sample
* Update of the Petstore CXF client sample
* Update of the Petstore CXF server annotated base path sample
* Update of the Petstore CXF server non spring application sample
* Changed {{name}} for {{baseName}} following the correction posted by @wing328
* Update of the Petstore CXF server sample
* Adds the ability to create code for an interface-based jaxrs client.
* Adds shell script and sample files for jaxrs-spec-interface
* rebase into adds shell
* Fixes bug in creation of Produces/Consumes in method annotation. Allows for instance "application/json; charset=utf-8"
* Fixes generated pom.xml
* Generate pom.xml by default
* Prettier output from api.mustache
* Fixes bug in mediatype, allowing charset-specification in swagger.yaml.
* Merges generation of interface-based jaxrs client/api into jaxrs-spec.
* Moves jaxrs-spec server interface to match location of jaxrs-spec server
* Makes Generated-annotation in genereated classes slightly prettier.
* Retrofit2: Return ResponseBody if response if file.
Until now
--------------------
If a swagger endpoint returned a file (e.g. an image), then the Retrofit2
template has choosen the return type java.io.File. However, retrofit cannot
deal with this and throws a com.google.gson.stream.MalformedJsonException.
New:
-------------------
If a swagger endpoint returns a file, then the corresponding Retrofit2 endpoint
will return a okhttp3.ResponseBody which can be used to retrieve the file.
* fix Interface Prefix
* Retrofit2: Return ResponseBody if response if file.
Until now
--------------------
If a swagger endpoint returned a file (e.g. an image), then the Retrofit2
template has choosen the return type java.io.File. However, retrofit cannot
deal with this and throws a com.google.gson.stream.MalformedJsonException.
New:
-------------------
If a swagger endpoint returns a file, then the corresponding Retrofit2 endpoint
will return a okhttp3.ResponseBody which can be used to retrieve the file.
* Add the option packageContext for nancyFx which allows a better adjustment of the namespace.
* run nancyfx-petstore-server.bat
* upgraded zend-expressive from version 1 to 2
* Changed error handler for compatibility with Zend Expressive 2
* generated newest sample files for Petstore ze-ph
* removed ErrorMiddleware because it is never been used anymore. Regenerated samples
* removed ErrorMiddleware Template from Codegen
* remove ErrorMiddleware from petstore sample
* Fixed some code styles
* regenerated ze-ph samples with corrected code styles
* added new line at the end of the file
* Fix Uuid parse
* Add isString = true when property is Uuid
This will not break previous code
* Update conversionBegin.mustache
* Update conversionEnd.mustache
* - Added javax.validation.Valid annotation to modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/bodyParams.mustache
- Added bean validation and api description to modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/headerParams.mustache
- Added api description to modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/queryParams.mustache
- Added interfaceOnly parameter management to modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java to generate only interfaces and models.
- Added interfaceOnly parameter management to modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/api.mustache
- Added throws java.lang.Exception to modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/api.mustache
* Run ./bin/jaxrs-spec-petstore-server.sh
* jaxrs-spec: javax.validation.Valid model attributes for array items
* Run ./bin/jaxrs-spec-petstore-server.sh
* Removals of most of the warnings found by lint
* Removals of most of the warnings found by lint (PART 2)
* Removals of most of the warnings found by lint (PART 3)
* Removals of most of the warnings found by lint (PART 4)
* Removals of most of the warnings found by lint (PART 5)
* Fix conversion error
* Removal of unnecessary import. Other will need more complex login in the generator itself (not in the mustache files)
* Add missing imports + fix to the regex. Generation of the samples
* Fix issue #6100. Tested with all the samples.
* Fix multiple issue with the examples. Removing all of this.
Adding fake endpoint .sh but it is not compiling right now.
* Changes to allow field names as examples for string properties and multiple items in array during example generation
* Reverting the version to 2.3.0-SNAPSHOT and autogenerated petstore files
* Added C++ generator for Pistache
* Revert of CodegenOperation
* Updated template
* Removed isRestful from method declaration
* Updated httpMethod variable
* Changed isRestfulCreate
* Updated pistache library name
* Update pistache petstore sample with the new library name
* Fix issue 5460
* Handling only first and last double quote to support example with double quote in the middle
* Fix proposed by @ePaul
* Add comments to explain de fixStringModel function. Add an enum model called PetStatus that test this scenario. Update sample only for JavaPlayFramework generator
* Add automatic validation of return type when beanValidation is activated
* Small fixes for the automatic validation
* Add validation of entering body object + fix problem when receiving list + do not validate when the return value is a file
* Major fix to the collection handling in Play Framework Generator
* Major fix to the collection handling in Play Framework Generator (small details missing from previous commit)
* Add the fix to header and form parameters too
* Fix to the default values. It did not take care of the "default" and also was setting to a bad default when not set.
* Just make a difference between string and non string instead of placing all types in the mustache file
* WIP: CodegenProperty with XML
* WIP: CodegenModel XML bits
* WIP: Jackson XML
* WIP: Java templating
* WIP: Java client withXml flag
* WIP: resttemplate work
* WIP: withXml only when Jackson is used
* WIP: Tabs to spaces
* WIP: java-petstore-resttemplate-withxml sample
* WIP: language: spring
* WIP: language "spring" using library "spring-boot" should include apiPackage in @ComponentScan to detect the API
* WIP: javax.xml for non-Jackson Java and enabled payload logging for jersey2
* WIP: updated java petstore samples
* WIP: JavaSpring with non-jackson XML
* WIP: bin/spring-all-pestore.sh
* - 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
* Started work on restbed improvment
* - Updated samples
- Reworked Resource class names
- Added vendor extension for new formatted resource class names
* fix indention
Adding the possibility to generate java Vert.X servers.
It uses Vertx-Swagger-Router project.
It can generate an Async callback version or a Rx version.
* updated Spring, Boot, Fox and Cloud dependencies
* run scripts for java, jaxrs-cxf and spring samples (although changes are not related to my changes)
* update jersey java8 petstore samples
* update java feign samples
* update java petstore samples
* add new files for java petstore clients
* roll back spring cloud dep version
* fix jaxrs-cxf error
* 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 feature option (#3819)
When you enable the feature useOptional the JavaSpring generator will use type Optional for non required parameters.
* Adds generated sample for #3819
* Adds generated sample for #3819
* Reverts commit for bean validation
* Adds generated sample for #3819
* Reverts commit for bean validation
* Fix alignment
* update spring samples
* update pom.xml to include spring use optional samples
* update artifactId to "spring-boot-beanvalidation"
* rpelace tab with 4-space
* check mvn task result