* Initial Eiffel Client code generator
TODO API and Domain model
* Updated EiffelClientCodegen to support Eiffel code style.
Added mustaches templates for models and apis.
The last one still under development.
* Updated templates, initial API generation.
Added client request template.
* Updated api.mustache style
* Updated code generation with a new directory layout.
Added test case generation, clean code.
* Updated Code generator, added apidoc and modeldoc
Updated readme file
* Added a Basic JSON Deserializer
Updated API client to support by default a basic json (de)serializer and let
the user customize then if needed.
* Updated Eiffel code generator to use Eiffel feature name style.
Updated templates to follow Eiffel style.
Improved feature descriptions.
* Added model inheritance support.
Removed unused code.
* Updated Eiffel code templates, refactor remove obsolte feature calls.
Added Eiffel sample in samples/client/petstore/eiffel.
* Updated Java code style.
* Fixed formating, using spaces instead of tabs.
* Updated EiffelCodeGenarator typeMapping.
Added TestCases for EfiffelClientOption and ModelTest cases.
Updated sample code to use the lastest changes.
* Restore keyword `nil' in Go Language.
* 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
* Add a swift4 client generator
* Updates per review comments:
- Changed Alamofire dependency from 4.0 to 4.5
- Added "Codable", "Encodable", and "Decodable" to list of reserved words in generator
- Ran "pod update" in default, promisekit, and rxswift samples test projects
* [Bugfix] Removed a debug print statement that sometimes caused crashes.
Change-Id: I62cf8d70faddfe855c7150927441465466dbaa53
Signed-off-by: akhilkedia94 <akhil.kedia@samsung.com>
* [Workaround/Fallback] Fix conversion of string representation of Json to JsonNode
Changed the conversion to consider any non-parseable string as a single "json string" object.
This is just a fallback to handle non-ideal server responses.
Change-Id: I5339d385e57b6225706fbaaaba1c04003c3810e9
Signed-off-by: akhilkedia94 <akhil.kedia@samsung.com>
* [Bugfix] Correct Handling of Non-String Value Types in Json Maps
Inside the Json Maps in server response, the earlier code was bugged if the "value" in the map was of a non-string type.
Change-Id: I8c34c7e9470fc0743b509917f8098b2ebe2bd4e5
Signed-off-by: Akhil <akhil.kedia@samsung.com>
* [BugFix/WorkAround] No "isPrimitiveType" in BodyParams
The "isPrimitiveType" value tells us whether the data type of a particular parameter is one if the primitive types.
This value is not present when iterating over all the body parameters, but is somehow present when
iterating over all parameters and filtering for only BodyParams.
Change-Id: I5b0a97e615b7300c33dc7f3d4673ad5e87c36f7e
Signed-off-by: Akhil <akhil.kedia@samsung.com>
* [Bugfix] Making Functions Static to Avoid Name Clashes
Multiple functions in different classes might named the same, hence leading to multiple functions of the same name.
Using static to have only internal linkage for these helper functions.
Change-Id: I97fb1dd64b176c4a2b95e6d923723469852bc85a
Signed-off-by: Akhil <akhil.kedia@samsung.com>
* [Enhancement] Minor Improvements to Documentation
Added Modules in Doxygen Doc, Improved MD documentation
Signed-off-by: Akhil Kedia <akhil.kedia@samsung.com>
* Regenrated petstore sample
Update the petstore sample with newest template files
Deleted older sample in samples/client/petstore/tizen/client/
The old samples use oblsolete APIs
(These are APIs for Tizen 2.0, removed in 2.4, current release is 3.0)
Signed-off-by: Akhil Kedia <akhil.kedia@samsung.com>
* [Bugfix] Fixes incorrect headers sent (#5980)
Regenerated the petstore as well.
Signed-off-by: Akhil Kedia <akhil.kedia@samsung.com>
* fix: es6 style of Array inheritance to fix transpiler error
* fix: rebuild of promise-es6 petstore samples with fixed mustache
style: added space between classname and bracket
* style: rebuild javascript-all to reflect style changes in mustache
* 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
* First iteration of updating the typescript-jquery template/generator
* first RC of the new version of Typescript-JQuery using better models.
* Minor fix to the generation
* first RC of the new version of Typescript-JQuery using better models.
* Add an options for people using this client in a legacy app and that already have jquery loaded with a script tag somewhere
* Generation of the samples based on the latest changes from the typescript-jquery generator
* Fix to the check if the value is null and undefined
* Small fix when using collection
* 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
* Closes#5863
The "dateLibrary" option for java, sadly, sets a mustache value "java8". This change updates this so that "java" in the mustache
libraries means what it should mean - use all java8 classes. In this case, there's no need for the third party Base64 library
as java8's JDK has this built in. In my view, the "dateLibrary" should be deprecated but that should be a separate PR.
* Closes#5954
built and ran tests/samples
* Closes#5863
The "dateLibrary" option for java, sadly, sets a mustache value "java8". This change updates this so that "java" in the mustache
libraries means what it should mean - use all java8 classes. In this case, there's no need for the third party Base64 library
as java8's JDK has this built in. In my view, the "dateLibrary" should be deprecated but that should be a separate PR.
* updated samples
* fixed tests for new CLI java8
* regenerated samples after master merge
* oops - left in an end tag after master merge
* rerun checks
* rerun checks
* updated versions
* match fix in 2.2.x branch
* updated with 73df07d64c
* regenerate pom.xml for jaxrs-cxf-petstore-server-annotated-base-path
* regenerate pom.xml for jaxrs-cxf-petstore-server-non-spring-application
* update dep for java jersey1, jersey2
* update sbt dependency for jersey2
* update dep for java okhttp-gson, resteasy, resttemplate
* update dep for java retrofit 1.x, 2.x
* update java petstore samples
* fix JS shell script, add log to show es version
* change CLI option default value for useES6
* fix shell script in JS ES6 promise
* fix windows batch files
* set useES6 to false
* add powershell generator (wip)
* minor fix to api template
* rename model files
* Powershell generator fix (#11)
* Fix typo
pacakge -> package
* Add missing `petstore` subfolder to $ClientPath
* Resolve $ClientPath to absolute path
Start-Process needs WorkingDirectory to be absolute
* Fix spaces in variable name
${ somevar } is a vairable that literally has spaces in name. We need to
temporarily redifine mustache delimiters so we can generate var. names
without spaces.
* Fix typo
Remove stray `r`
* Fix *.ps1 import in module
Directory structure has changed + we should export functions using
manifest.
* Remove erroneous file
* various fixes and enhancements
* remove nullable for string
* change function name based on feedback by beatcracker
* set index to start at 0
* fix file type
* Powershell generator fix 1 (#12)
* Add closing curly brace
* Fix duplicated '['
* Get FunctionsToExport using AST
Discussion: swagger-api/swagger-codegen#5789
* add guid option to powershell generator
* add test files, remove docs
* fix array of items
* clean up powershell comment, update model/api test files
* - 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 step in fixing the cpp rest template
regenerated new samples
TODO: Fix the other functions
* Updated samples
* Changing QBuffer to use a QByteArray solves the issue for me since there is no real use-case for using a QBuffer.
Documentation of QT5 states:
QBuffer::QBuffer(QByteArray *byteArray, QObject *parent = Q_NULLPTR)
Constructs a QBuffer that uses the QByteArray pointed to by byteArray as its internal buffer, and with the given parent. The caller is responsible for ensuring that byteArray remains valid until the QBuffer is destroyed, or until setBuffer() is called to change the buffer. QBuffer doesn't take ownership of the QByteArray.
Since the variable “request_content” is allocated on the stack, this is clearly wrong and a bug. The construction of QBuffer is designed this way so that whenever you write to the buffer, it is also written to the byte array that it is pointing to
* Add a retro-compatible solution based on QNetworkAccessManager SourceCode
* update samples
* added headers to makeRequest function for swift3 template
* Added configuration file to Swift3 template
* added comments about the value read only once
* added comments about the value read only once
* comments fix
* Added Configuration.swift to Project File
* swift 3 promisekit, rxswift updates
* adapt the resttemplate target for the threeten Time API
* add threeten dependencies to build.gradle
* fix missing dollar sign
* fix missing dollar sign
* Do not generate pom.xml and README.md when interfaceOnly=true #5542
* New swaggerDocketConfig option, to generate Spring configuration class for Swagger Docket bean. Ignored when interfaceOnly=false or library=spring-cloud #5542
* Updated tests running ./bin/spring-all-petstore.sh
* Run ./bin/spring-all-petstore.sh
* Fix for issue #3638
* Update tests for fix for issue #3638
* Fix bug when queryParams and collectionQueryParams are both specified
* Update tests
* Add certain tests back, address CI failures
* Update samples for several languages.
Just whitespace changes and some reordering where the order doesn't matter.
* Adding generated .swagger-codegen/VERSION files.
* [kotlin] support collectionFormat:multi
Adds "multi" support to collections.
Also changes generic lists (List<T>) to arrays. Generic lists and nested
lists can be problematic and require customized json factories. The
previous implement appeared to work because the results in the test were
LinkedHashMap with count greather than 0. The functional test has been
updated to force serialization and verify the results.
* [kotlin] Regenerate sample
* [kotlin] Update model test for Array changes
* [Swift3] Add lenientTypeCast option
When set to true, this generates a client JSON decoder
that will accept and cast mistyped values.
Here:
- String => Bool ("true" instead of true),
- String => Int ("123" instead of 123),
- NSNumber => String (123 instead of "123").
The point is to allow the same client code to handle several
server implementations that may (sadly) not be up to spec,
or still be "evolving".
The conversion is not guaranteed if the input
Not a perfect/complete solution, not sure if it should be
activated along other casts, so kept behind an option.
* Update Petstore client code
* Fix issue with buffered sink handling in okhttp
Fixes unexpected end of stream exceptions when using the okhttp-gson library
and making asynchronous calls.
* update petstore samples for okhttp-gson
$ ./bin/java-petstore-okhttp-gson.sh
$ ./bin/security/java-petstore-okhttp-gson.sh
* WIP: trigger ci
* add pod file for swift3
* skip pod install
* avoid pod install in swift3 petstore (promisekit,rxswift)
* use https instead of http for cocoapod spec
* avoid timeout in swift3 test
* enable travis CI tests for swift, objc, move some tests to circleci
* fix comment in xml file
* use xcode8.3
* use ruby 2.2.5
* fix objc core data pom.xml
* use cocoapods 1.2.1
* use xcpretty for clearer test results
* fix pom with relative path to script
* comment out objc test
* fix xcpretty exit code
* add && exit ${PIPESTATUS[0]} for swift3 xcodebuild script
* use xcode 8.2
* update promisekit version for swift 2x, 3x
* add pod repo update
* remove Pods directory
* update swift dependencies to the latest version
* update podfile.lock
* rollback Alamofire to 4.0 for swift3
* fix swift3 rxswift api cliiet
* fix testDeletePet test in Swift3 rxswift petstore
* update clojure petstore
* comment out clojure test in travis (already covered in circleci)
* run pestore server locally
* use wing328/swagger-samples to run petstore
* run petstore server in the background
* test ruby petstore client
* add /Users/travis/.cocoapods/repos/master to cache
* add back ruby test, use public pestore server
* add back bash client test
* add npm config set registry to avoid time out
* use docker branch in swagger samples
* remove bash test
* show go version, reorder
* debug go petstore client
* reinstall go
* comment out pod repo update
* uncomment pod repo update
* test go in circleci
* remove go from travis test
* brew install sbt
* [kotlin] Add model enum support
Model variables marked isEnum=true are nested class enums. Top-level
enums will not be isEnum=true, but rather have a datatype specific to
the enum's type.
* [kotlin] Regenerate client sample
* [csharp] refactor ApiClient and Configuration usage
* # This is a combination of 2 commits.
# The first commit's message is:
[csharp] refactor ApiClient and Configuration usage
[csharp] Regenerate sample
# This is the 2nd commit message:
[csharp] Simplify setting apikey/prefix/headers
* # This is a combination of 2 commits.
# The first commit's message is:
[csharp] refactor ApiClient and Configuration usage
* Simplify setting apikey/prefix/headers
* Regenerate sample
# This is the 2nd commit message:
[csharp] Pass-through configuration timeout to client
* [csharp] refactor ApiClient and Configuration usage
* Simplify setting apikey/prefix/headers
* Regenerate sample
* [csharp] Regenerate all client samples
* [csharp] regenerate .net standard/core samples
* [csharp] Fix Timeout diff between netstandard and non-netstandard
* [csharp] Resolve additional netStandard issues after merge
* [csharp] Update doc for Configuration usage
* [kotlin] array->List instead of Array
Serialization to/from primitive arrays can cause issues with valid
responses. This commit considers swagger 'array' types as 'List' which,
although not as memory efficient should provide a cleaner interface for
users (and avoid serialization issues).
Also, updates README.md to list new generator and excludes
folder at samples/client/kotlin/bin/, which is not used.
* [kotlin] Move sample under conventional directory
samples/client/kotlin/ -> samples/client/petstore/kotlin/
Updated new.sh to generate client/server/docs into similar structure.
Current documentation generators (cwiki, html, html.md, html2) aren't
following a convention like client/server generators.
This commit adds Api/Model/Auth documentation to the generated
README.md. Because auth support is not yet fully implemented (users can
manually set default headers globally), there aren't examples for helper
auth methods.
Models with inline enums document allowed values rather than pointing to
a generated enum class.
Two global additionalProperties were added (generateApiDocs,
generateModelDocs) to allow templates to conditionally display
documentatoin depending on these mutually exclusive settings. All
current generators supporting docs will attempt to link to generated
models when only api docs are specified.
This also moves the $@ bash parameter in bin/kotlin-client-petstore.sh
to the end of the args variable. This is because $@ can only be used to
pass System properties like -DdebugModels, can can already be passed as:
JAVA_OPTS="$JAVA_OPTS -DdebugModels" ./bin/kotlin-client-petstore.sh
By moving the $@ to the end of the args, it allows us to pass additional
properties and other switches directly to the script.
* [Ruby] Modify file download to be written in chunks in order to handle large files. #5704
* [Ruby] Update Ruby Petstore with file download improvement. #5704
* Added mustache file for namedCredentials
* Removed Basic and OAuth from Apex API in favor of NamedCredentials
* Moved old README to README for ant deployment
* Added SFDX OSS descriptor
* Removed remoteSite mustache
* Changed package.xml from RemoteSite to NamedCredential
* Update ApexClientCodegen to support SFDX and namedCredentials
* Created initial README for Salesforce DX
* Ran Petstore test for Apex commit
* Fixed error in README mustache
* Updates http-client dependency to one that correctly handles certificates
This is important as amazon AWS gateway and several other types of certificates will not work correctly due to the old java library used by the 2.0.0 version of http-client.
* Runs the petstore updates switch for clojure
* Runs the petstore updates switch for clojure
* remove trailing space in cpprest, update samples
* remove unused pom.xml in go pestore
* fix broken links in php api doc by fixing baseType
* fix csharp api doc
* fix php examples
* fix examples for abstract php generator
* gh-4044: Added useES6 as an option for javascript templates
* gh-4044: Enabled ES6 in `javascript/api.mustache`
* gh-4044: Enabled ES6 in `javascript/ApiClient.mustache`
* gh-4044: Enabled ES6 in `javascript/enumClass.mustache`
* gh-4044: Added useES6 cli option to `javascript` clients and updated the test cases
* gh-4044: Enabled ES6 in `javascript/index.mustache`
* gh-4044: Enabled ES6 in `javascript` model templates
* `javascript/model.mustache`
* `javascript/partial_model_generic.mustache`
* `javascript/partial_model_enum_class.mustache`
* `javascript/partial_model_inner_enum.mustache`
* gh-4044: Separated `javascript-es6` templates to another folder
* gh-4044: Updated `javascript-es6/index.mustache`
* gh-4044: Enabled ES6 in `javascript-es6/api_doc.mustache`
* gh-4044: Added required dependencies for ES6
* gh-4044: Updated Supportig files for ES6 and non ES6
* gh-4044: Added test scripts to verify `javascript` useEs6 option
* gh-4044: Commented `javascript-es6` scripts due to the permission issues.
* Implement generating interfaces option for api resources, closesswagger-api/swagger-codegen#5453.
This commit introduces another _system property_ for typescript-angular2, called `withInterfaces` that is default to `false`. You can activate this flag by:
```
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i http://petstore.swagger.io/v2/swagger.json \
-l typescript-angular2 -o samples/server/petstore/springboot/typescript-angular2 \
-D withInterfaces=true
```
If set to `true`, generated api resource classes will be implemented with their interfaces in separate files.
This change should not break and change the behaviour even though `withInterfaces` flag set to `true`. You are also welcome to create your own custom resource class by implementing those generated interfaces as they support defining new attributes with `[others: string]: any;` signature.
* Fix unit test for typescript/angular2 client options for "withInterfaces"
* Use double quote to follow coding standard
* Respect interface naming convention for typescript/angular2
Create respectful interface names that ends with `Interface` suffix, instead of prefixing with `I` according to typescript naming convention. This is also consistent with their file names that also ends with `Interface.ts`.
Also fixes the merge conflicts.
* Have better explanation for the `withInterfaces` system config
* ignore .vscode
* fixed test case for models requiring mandatory attributes. added deserialize test for enum class
* construct model with mandatory attributes. improve class reflection (e.g. deserialize). disable generated empty model unit test for further FIXME
* rebuilt samples
* FIXME comment
* FIXME comment
* fix deserialization enum test
* Disable Jackson FAIL_ON_INVALID_SUBTYPE in feign
With this change, Jackson does not fail even if it doesn't recognize a
discriminator type name. This is helpful when upgrading a microservice with
a new subtype while keeping compatibility with its old clients. The instance
is returned as null instead of throwing an exception deep in the feign
framework, allowing clients to gracefully degrade.
* Disable FAIL_ON_INVALID_SUBTYPE for all Jackson-based projects
With this change, users providing custom configuration must provide an exported Configuration factory, rather than just an object. This is needed to be Angular AoT compatible.
Example use:
import * as api from '../api';
/** Configuration settings for the backend API */
export function backendConfigurationFactory(): api.Configuration {
return new api.Configuration({basePath: '/api'});
}
@NgModule({
imports: [api.ApiModule.forConfig(backendConfigurationFactory)],
...
* 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
* Added PowerShell module. See #4320
MVP PowerShell module to serve as a template for a PowerShell generator.
* Fixed function name
* Removed module manifest
It should be generated by the build script
* Ignore module manifests
* Removed binding from prop. name for Pet
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.
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