* Adding support for non dictionary body types.
* Adding test for rest of the swift3 types
* Cleaning up implementation of makeRequest and adding better error handling.
* Adding ClientError for error produced before request is sent.
* Changing how encoding of body data is handled.
* Cleaning up code that was modified.
A previous change to make the regex a variable to allow proper linting
resulted in the regexp not having access to the value associated with
the variable and the path variable not being replaced.
Moves the regexp variable inside the for loop to allow the value to be
used and the path variable to be replaced with the provided value.
* Fix dependencies and generate model classes
* Better elixir client generation.
Responses are parsed and serialized by Poison into the model structs.
Use shared helper functions to generate the request.
Extract client connection configuration from api calls.
Elixir client can sanitize the operationId
Correctly output the model variables. Fix typos
Fix path replacement when there are multiple replacements
Cannot separate globally shared parameters from operations
Error handling for the tesla response
update templates
Can generate clients that compile
Can make requests - parse optional params, build query
Add oauth to connection. Fix connection directory
Add basic auth helper for creating a connection
Fix map types. Fix guard clauses for creaing connections
Add licenceInfo template. Parse config for moduleName via standard invokerPackage option
Can provide and inject a license header into all source files
fix location of connection.ex
Move shared code into reusable modules
Elixir filenames should be underscored
Fix visibility of helper functions
Parse the packageName from config options
Handle date and datetime fields with DateTime.from_iso8601
Fix indentation
Update documentation, add typespecs
Generate a standard elixir .gitignore
typespec is calculated recursively in java
Use the JSON middleware and using Poison.Decoder.decode on already parsed structs
move decoded struct into java
Fix handling of non-json responses
Switch basic auth to use the provided Tesla.Middleware.BasicAuth
Update README template to include the appDescription
Update sample elixir client
remove junk client models that don't belong with petstore
Only implement Poison.Decoder protocol if needed
Update samples with skipped Poison.Deocder impl
* Handle multipart file uploads
Handle building form params in the body
Files are handled as strings for input
* Requests with no defined return type will return the Tesla.Env response
* Run the bin/elixir-petstore.sh
* * Fix bugs in api.mustache, model.mustache, mostly bracket errors or small typos
* Added section about installation in README.mustace
TODO: fix tests in testthat
TODO: fix bug in description.mustace regarding package name
* Updates to sample for R client caused by running ./bin/r-petstore.sh (or .\bin\windows\r-petstore.bat)
* Add R specific files to .gitignore
* [R] add additional files generated by the petstore sample. (see #6520)
The only special handling was for security definition type `apiKey`
in `query`. All the other security configurations should result in the
same generated code.
Moves the handling of the special query parameters outside of the
`parameters without specific cardinality` section.
To cover the scenario where `elif` was being used, simply leverage the
builtin `continue` statement to stop processing the specific query
parameter and continue to the next available query parameter, if any.
Manually test with multiple different combinations.
Resolves: #6526
* Update samples
./bin/php-petstore.sh
* Remove unnecessary implements entry
ModelInterface, ArrayAccess are already implemented in parent
* Remove field `container` which is already defined in parent
* Change snake case to lower camel case
- invalid_properties
- allowed_values
* Improve doc commenct style
* Improve description length
* Improve length
* Doc comment short description must start with a capital letter
* Add a line between @param and @return
* Delete an additinal blank line at end of doc comment
* Udpate petstore-security-test
Previously, we had implemented the Codable protocol by simply claiming conformance, and making sure that each of our internal classes also implemented the Codable protocol. So our model classes looked like:
class MyModel: Codable {
var propInt: Int
var propString: String
}
class MyOtherModel: Codable {
var propModel: MyModel
}
Previously, our additionalProperties implementation would have meant an object schema with an additionalProperties of Int type would have looked like:
class MyModelWithAdditionalProperties: Codable {
var additionalProperties: [String: Int]
}
But the default implementation of Codable would have serialized MyModelWithAdditionalProperties like this:
{
"additionalProperties": {
"myInt1": 1,
"myInt2": 2,
"myInt3": 3
}
}
The default implementation would put the additionalProperties in its own dictionary (which would be incorrect), as opposed to the desired serialization of:
{
"myInt1": 1,
"myInt2": 2,
"myInt3": 3
}
So therefore, the only way to support this was to do our own implementation of the Codable protocol. The Codable protocol is actually two protocols: Encodable and Decodable.
So therefore, this change generates implementations of Encodable and Decodable for each generated model class. So the new generated classes look like:
class MyModel: Codable {
var propInt: Int
var propString: String
// Encodable protocol methods
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: String.self)
try container.encode(propInt, forKey: "propInt")
try container.encode(propString, forKey: "propString")
}
// Decodable protocol methods
public required init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: String.self)
propInt = try container.decode(Int.self, forKey: "propInt")
propString = try container.decode(String.self, forKey: "propString")
}
}
class MyOtherModel: Codable {
var propModel: MyModel
// Encodable protocol methods
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: String.self)
try container.encode(propModel, forKey: "propModel")
}
// Decodable protocol methods
public required init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: String.self)
propModel = try container.decode(MyModel.self, forKey: "propModel")
}
}
This is the equivalent change in the swift4 module which was made in the swift3 module in this PR:
https://github.com/swagger-api/swagger-codegen/pull/6274
This updates AlamofireImplementations.mustache to handle when the response is an URL. It also makes changes in the generated sample code for:
* default configuration (no promisekit or rxswift)
* promisekit
* rxswift
Also, in order to build, the generated code needed to be updated with the change in CodableHelper which changes dataDecodingStrategy to ".base64" from its previous definition in earlier Xcode 9 betas.
*
* point readme links to canonical locations
* use lenses for non-required model fields, instead of traversals
* fix .gitignore generation
* fix dateFormat cli option bug
* [ANDROID][volley] Handle UnsupportedEncodingException in invokeAPI (Issue #6432)
The constructor of StringEntity can throw UnsupportedEncodingException, which is not catch nor thrown by createRequest method.
Therefore the build of android client fails with:
ApiInvoker.java:448: error: unreported exception UnsupportedEncodingException; must be caught or declared to be thrown
This commit adds a try ... catch on UnsupportedEncodingException in invokeAPI methods and declare this exception to be thrown in createRequest
* [ANDROID][volley] Handle UnsupportedEncodingException in invokeAPI (Issue #6432)
The constructor of StringEntity can throw UnsupportedEncodingException, which is not catch nor thrown by createRequest method.
Therefore the build of android client fails with:
ApiInvoker.java:448: error: unreported exception UnsupportedEncodingException; must be caught or declared to be thrown
This commit adds a try ... catch on UnsupportedEncodingException in invokeAPI methods and declare this exception to be thrown in createRequest
* [ANDROID][Volley] Handle UnsupportedEncodingException (Issue #6432)
Throw more precise ApiException
* [csharp] Explicitly set supportsInheritance
* [csharp] set supportsInheritance for client
This includes supportsInheritance only for the client codegen at the
moment, because setting in AbstractCSharpCodegen would require the
change to be tested in all derived generators, possibly including
similar template changes to this commit's.
* include nice improvement of https://github.com/jimschubert/swagger-codegen/tree/csharp/3829 and leverage https://github.com/manuc66/JsonSubTypes for subtype deserialization
* remove duplicate base validations
* remove useless tests
* restore documentation for properties coming from parent
* launch bin/security/csharp-petstore.sh
* it's impossible to call an explicitly implemented interface-method on the base class
(https://stackoverflow.com/questions/5976216/how-to-call-an-explicitly-implemented-interface-method-on-the-base-class)
* restore portion of code that was lost
* regenerate more
* fix missing using
* take the multi .net compatible revision
* keep generated model simple when no hierarchy involved
* regenerate with:
- bin/csharp-petstore-all.sh && bin/security/csharp-petstore.sh
- bin/csharp-dotnet2-petstore.sh && bin/csharp-petstore.sh && bin/csharp-petstore-netcore-project.sh && bin/csharp-petstore-net-standard.sh && bin/csharp-property-changed-petstore.sh
* fix sln indentation and the missing windows runner for dotnet2
* fix inheritance GetHashCode and Equals
* override instead of hiding the base method
+ fix the csharp-property-changed-petstore.bat
* By default the value of the discriminator property must be the name of the current schema
* Add test for subtype deserialisation from parent type
* add missing '.bat' and use the 'call' template from javascript-petstore-all.bat
add missing file to trigger it on windows
* fix default value bug
* cleanup copyright information
* formatting after merge
* fix merge
* applying bin/csharp-petstore-all.sh
* applying bin/security/csharp-petstore.sh
All Model classes include a set of methods - it makes sense to align them to a concrete interface to improve strict typing when referencing these models.
* add r client codegen
* update r api, model templates
* various fix
* rename Json to JSON
* more enhancements
* fix json handling
* add file upload support, var name to handle hyphen
* use httr::upload_file
* two fixes: 1) extra ?'s at end of some url's 2) enums not being called out w/ rawValue to get the proper string name
* update samples
* one step closer
* closer implementation
* break on optional decode failing since it's an optional we don't want to fail the whole decode
* update samples
* two fixes: 1) extra ?'s at end of some url's 2) enums not being called out w/ rawValue to get the proper string name
* update samples
* one step closer
* closer implementation
* add back in array decoders
* regenerate samples
* Use the right package name for the Rust crate.
* Change getters on models to return Option for non-required fields.
* Cleanup Rust generation and get example compiling again.
* Use underscore names for functions.
* Implemented support for Play! 2.5.x / java8
* Added petstore sample for play25
* implemented play25 support
implemented version switch via playVersion config option
* fixed compilation failure after merge
* Disabled generation of CustomInstantDeserializer if dateLibrary equals to java8
* two fixes: 1) extra ?'s at end of some url's 2) enums not being called out w/ rawValue to get the proper string name
* update samples
* one step closer
* closer implementation
* fix unwrapRequired models when we have a parameter named result
* Rrename for angular and angularjs to reflect naming guidelines
see http://angularjs.blogspot.com.au/2017/01/branding-guidelines-for-angular-and.html
- move makes typescript-angular -> typescript-angularjs
- move makes typescript-angular2 -> typescript-angular
Language string with generate was already this so generation shouldnt change
but class naming follows this convention now
* Fixing merge problems
* Support additionalproperties and more.
- Upgrade to TypeScript 2
- Use type definition from npm instead of typings, typings is deprecation
- Use Enum instead of String Literal Types
- Use typescript es6 lib for target es5
- Support additionalproperties
- Support JSDoc
- Add snapshot and npmRepository option
- Update typescript-fetch run script for linux
- Create typescript-fetch run script for windows
* Update and fix
- Fix circle run script
- Fix duplicate query parameter
* Rename typescript-fetch folder to lowercase
* Fix for review and update new line end of file
* Fix end of file
* rename script to {lang}-petstore-all.sh and fix test
* Fix override query string
https://stackoverflow.com/a/7517673/1077943
* - check C++ keywords
- setter for SSL configuration
* recreate example QT5CPP
* only emit error signal if error happens
* provide more error information
* regenerate example QT5CPP
* * use reserved words in abstract cpp generator
* update CppRest examples
* remove tabs
* two fixes: 1) extra ?'s at end of some url's 2) enums not being called out w/ rawValue to get the proper string name
* update samples
* one step closer
* closer implementation
* fix build when using unwrapRequired option
If a data class has no optional parameters, a trailing comma (which was
supposed to delimit the list of required and optional parameters) will be
inserted after the last required paramter, leading to a syntax error in
Kotlin.
* fix a bug whereby OAuth intercept method calls itself forever
When the response is 401 or 403, the interceptor assumes that it is because of token so it keeps retrying the request with new token. However if the response status is due to the fact that authorization to the api endpoint failed, and not due to invalid token, then a recursive operation of updating token and re-requesting the failed request happens.
* change binary OR operator: | to normal OR operator: ||
although binary may work, it's unusual and likely was unintentional.
* [java-vertx] make vertx client support running on different contexts
* [java-vertx] make vertx client support running on different contexts (samples)
* 1st commit of lua generator
* add petstore sample
* various fixes based on feedback
* better return handling
* check status code 1st letter
* add support for query parameters, auth, body param
* more fixes based on daurnimator feedback
* more fixes based on daurnimator feedback
* fix a few more issues found by luac -p
* use lower case for http header key name
* more fixes based on feedback
* update lua sample
* skip auto-generated readme, doc, test files
* use tab instead of 2-space
* fix container return type
* fix cast method call
* fix cast function call
* add rust generator (1st release)
* update based on feedback
* fix reserved keyword
* fix string parameter
* Convert String to &str in trait definition
* Only pass pathParams to uri builder
* Fixed the html escaping in return type
* Fixed the hashmap constructor
* Added models into API scope
* removed models subimport, reference from super
* update returntype in method signature
* Fixed the remaining templates inconsistencies
* Fixed issues that floated up in kubernetes swagger file
* add hash support, fix docstring
* fix map parameter, update api.mustache
* use baseName for parameter
* use fully-qualfiied model name
* add rust tests
* fix test cases
* Rust gen slightly more idiomatic (#6247)
* Go -> Rust in README
* Remove leftover go file in rust sample
* rust: Regenerate sample
* rust: Rename *Impl -> *Client
* rust: one-line use line
More in line with common style
* rust: Replace tabs (in java) with 4 spaces
* Added trivial getter implementation (#6249)
* update rust petstore samples
Fixed typo in shell script
Added support for Outer Enums, inner enums not supported.
Added missing UUID library in ecf template.
Improved Model inheritance.
* 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
* removed typings for typescript-node language and updated typescript version
* updated sample of typescript-node by running .\bin\windows\typescript-node.bat
* More flexible subclassing of ApiClient possible by s/private/protected/g
I found myself in a situation where I needed to change the configured `Feature`s, but
because of all the private variables I was not able to do so. Perhaps this is a bit too
broad of a stroke, but I changed all fields and methods to `protected` instead of `private`.
In this way, future extensibility should be improved.
Also, to solve my particular problem, I added a new empty method called
`performAdditionalClientConfiguration` which will allow subclasses to add specific features,
or do anything else possible with a `ClientConfig`.
* Updated samples
commit e3210cf8cc679c54f5c0d8d4fda2db6af1ee5bcf
Author: wing328 <wing328hk@gmail.com>
Date: Sun Jul 23 17:41:44 2017 +0800
comment out failed kotlin test
commit ed6bd1b92464f56885bc3cfa5d30936ce4a3d53d
Author: wing328 <wing328hk@gmail.com>
Date: Sun Jul 23 17:17:20 2017 +0800
test kotlin the last
commit a601445d04d0935f6a80a5052f1b4c6c3ee514d2
Author: wing328 <wing328hk@gmail.com>
Date: Sun Jul 23 16:56:40 2017 +0800
add test for kotlin client
* Improve generated code in APIs so to use the most of Swift SDK
Improve generated code in APIHelper so to remove duplicated code and reuse existing checks
* run ./bin/swift3-petstore.sh
* Run ./bin/swift3-petstore-all.sh to update all the Petstore samples
* Restore old implementation and fix using .isEmpty in place of .count
* Run scripts to update pet store samples
* Reverte changes that use reduce
* Bug fixes on APIHelper template
* Fix build error in Xcode 9 beta 3, as .compact is no longer defined
* Add test schema for Swift 4 and associated script and config files
* Add test app for swift4Test.json schema
* Make integer, Integer, int, and Int32 types map to Swift Int type instead of Int32 type
* Add CodingKeys to model template, which allows us to serialize/deserialize variable names that are different than property names
* Make updates to Swift 4 test schema
* Fixes for unit test app for swift4Test.json Swift 4 test schema
* update pom to prepare 2.2.3 release
* add header support to qt5, update samples
* update version in java help
* update to xcode 9
* rollback to xcode8.2
The [java8 doclint](http://openjdk.java.net/jeps/172) rejects unescaped
HTML chars such as `<`, making some generated clients unbuildable with
java8. Seems a few property descriptions were using the `{{{` instead
of `{{` preventing those HTML chars from being escaped properly.