* [Python] Improve model equality implementation
The model equality implementation template blindly tried accessing the
`__dict__` attribute of the variable to compare equality against. This
attribute does not exist for a lot of Python built-in types (`None`,
`str` etc.) and the equality check would simply crash.
This adds a simple guard to only continue with equality check if the
variable to compare is an instance of the model being compared against.
* Remove wrong auto-update of Python requirements
* 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
When constructing an enum through constructFromObject the original value provided by the API response should be returned rather than extracting the value from the enum name. This resolves an issue where the constructed value is undefined when the name and value are not equivalent.
* issues 4554: Handle 204 response and handle deserialize exceptions
* issue-4554: generate javascript client updated template
Used petstore-with-fake-endpoints-models-for-testing.yaml
* use petstore-with-fake-endpoints-models-for-testing.yaml like sh script
* fix camelized name with suffix/prefix in java client
* fix php model name with prefix, suffix
* fix indentation in ts abstrat generator
* replace tab with spaces in ts abstract generator
* [java] Attach Javadoc to artifact generation.
* [java] Attach source to artifact generation.
* [java] Add gpg signing to artifact publishing.
* [java] Add artifact URL to pom.xml .
* [java] Add artifact description to pom.xml .
* [java] Add artifact URL and description params to Jax RSS.
* [java] Add developer info to pom.xml .
* [java] Parameterise SCM info in generated pom.xml .
* [java] Move GPG signing to verify phase so that .asc files are uploaded during deploy phase.
* [java] Change GPG signing to be an optional via Maven profile. Can't assume all users will perform a release/deploy from an environment with correct GPG key/pass.
* update java petstore smaples
* camelize tag name, remove invalid file
* add back missing files for okhttp-gson
* fix docstring in java feign client
* fix docstring with various java api clients
* fixes#4432 Adding support for the modifier within the Jaxb XMLElement annotation. Updated README with JaxbAnnotations configuration option.
* #4432 Running the Petstore files
* ISSUE-4531
Arrays are now serialized according to the different collection formats. All api classes are also exported in a const array to make handling of large api libraries easier.
* Added petstore samples
* Fixed indentations and coding style
* Remove unnecessary call to setHost() in the constructor
The default host will be automatically set on the client by the ApiClient constructor.
* Updated PHP API Classes corresponding to template updates in #4525.
* Additional changes generated by the petstore update unrelated to #4525, but seem to have not been included yet.
* Add test to prevent regressions of #4525
* Overriden objectmapper wasn't used in deserialisation
Use previously provided apiInvoker instead of creating a instance at deserialision stage
* update scala sample
* Fix Gson parsing of Joda DateTime without millis
The DateTimeFormatter returned by ISODateTimeFormat.dateTime() only
parses dates with millisecond values, and throws
IllegalArgumentException when milliseconds are not present. The
date-time construct from RFC 3339 Section 5.6 referenced by the
Swagger/OpenAPI spec allows fractional second values to be omitted.
This results in valid date-time values being rejected by the generated
code.
This commit fixes the problem by using .dateOptionalTimeParser() for
parsing, which correctly handles date-time values without fractional
seconds. A previous version of this commit used .dateTimeParser(),
which accepted a time without a date and was considered too liberal.
Note that .dateTime() must still be used for printing, which is not
supported by .dateTimeParser().
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
* Fix akka-scala date-time parser with Joda
As in the previous commit, which fixed Java generators,
ISOISODateTimeFormat.dateOptionalTimeParser() should be used for
date-time parsing and ISOISODateTimeFormat.dateTime() for printing.
Apply the same change to akka-scala.
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
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>
* Objective C: Fix compilation warnings
If returnType is not provided, set the @return as void
* Run the `./bin/objc-petstore.sh`
* OBJECTIVE C SDK: Remove the return line for methods that return nothing all together
* obj-c sdk: Updated petstore sample
* implemented core integration with play 2.4 ws
* added shell script to test on CI
* added shell script to composite file for all java generators
* added some comments
changed promise param to Response<T> to allow access to http status code and raw response if needed
* removed unnecessary whitespace changes
* added java7 compatibility, play ws deps to pom.xml
* added generated play24 client
* fixed imports
* allow function so access token can be derived for each api call
* update tests
* update type for accessToken to be string or function that returns string
* fix syntax error
* better code format for android volley
* better code format for apiinvoker, add docstring
* use 2-space indentation for pair class
* use 2 spaces indentation for other classes in android
* allow function so access token can be derived for each api call
* update tests
* update type for accessToken to be string or function that returns string
* Fix for #4322
Signed-off-by: Sebastian Haas <sebastian@haas.tech>
* Run typescript-angular2-petstore.sh
Signed-off-by: Sebastian Haas <sebastian@haas.tech>
* Run typescript-angular2-petstore.sh
Signed-off-by: Sebastian Haas <sebastian@haas.tech>
Put query parameters between quotes and access object keys using square
brackets to make sure special characters are handled in parameter
names.
Closes#4284
* Fix support for 'class' properties in Java codegen
Currently Java codegen works successfully for property named 'class' but
fails on '_class', '__class', etc, because of 'Object.getClass()'
overloading.
This fix is intended to avoid all Object method overloading cases.
* Regenerated samples for Java petstore-security-test
* Add two override points inside AlamofireRequestBuilder in the Swift 3 template.
These allow the caller to control the request configuration (e.g.
to override the cache policy) and to control the Content-Type that is
given to an uploaded form part.
* Regenerate with ./bin/swift3-petstore-all.sh to match recent changes.
This includes a few minor changes that weren't made in this branch, so this
apparently wasn't run on master after some other recent changes.
* 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
* address unused parameters and possible-nullity warnings that newer versions of typescript give for this file
* update example generated clients using the new nullability code
* Allow multiple requests in parallel in Python client
If you tried to do two parallel calls to the same API object in the
Python client you would get an error from urllib3 connection pool:
Connection pool is full, discarding connection: ***
Because the default maxsize=1:
f9409436f8/urllib3/connectionpool.py (L162)
By defaulting to a higher maxsize we mitigate for the common use case
where a user is running a couple of requests in parallel.
Ideally, in the future, this should be a configuration paramater
together with the pool size.
* Add sample code after changing maxsize
* Add constructFromObject to Javascript enum generation.
Generated code calls constructFromObject on enum types, but enum did not define the necessary function. Returns the value of the enum.
* Update Petstore JS API client
* Swift3 inheritance support
* Mode inheritance support
* Handle 204 No Content without crashing
* Added some new reserved words for Swift (Error, URL)
* Update swift3 pet store example
* PR feedback fixes
* removed unnecessary newline from Models.swift
* removed unnecessary code comments
* ~~public~~ open
* Typo
* Fix review feedback
* fixed comment
* Corrects issue #3410 when trying to create Arrays of primitive types
* Use c++11 nullptr keyword and various indentation issues resolved
* ran petstore on new mustaches
* [csharp] Fix apiPackage,modelPackage,excludeTests
The apiPackage, modelPackage, and excludeTests values were not being
populated correctly from external configs (passing -c filename to
generator).
This commit allows those properties to work correctly with the Csharp
client generator. Previously the Api and Model namespaces were hard
coded after additionalProperties for these were evaluated.
The files which generate test files for models and api classes
didn't honor the excludeTests option.
* [csharp] Regenerate sample
* [csharp] Fix modelPackage in README template
* Sanitize tuples properly
In Python, Tuples are fixed size in nature whereas lists are dynamic. So
they should be sanitize as same as lists.
Failure case here is when you have a query or post parameter as
Datetime.
* Update the Petstore sample
* Skip file sanitization
* Return tuple instead of list
* Sanitize all tuples, no exceptions
* Extended request generation logic with support for serialized body content types other than Json
* Updated the Petstore Python client tests
* Fixed body content type identification for strings
* Fixed errors with cpprest client generation when generating a client that uses arrays of primitive types (vector) and file responses (HttpContent).
* Updated the petstore sample using script.
* Removed debug code.
* Removed extra newline to match master.
* Fixed binary file handling in cpprest. Updated petstore samples.
* Update readme to add Cummins to list
* Cleaning up for pull. Removing unnecessary changes.
* Fixing petstore
* Fixing error in build.
* Fixed error in stream copy for binary data
* Replaced tab with 4 spaces in all modified files.
Replaced tab with 4 spaces in all modified files.
* fix jaxrs line break
* fix java gradle bat line break
* fix scala gradle line break
* fix undertow crt line break
* fix spring line break
* fix undertow line break in pom
* rollback undertwo petstore to use petstore.yaml
* Removed redundant quotation mark
This additional quotation mark is causing problems in out project and should be removed.
ngrep output:
```
Content-Disposition: form-data; name="file"; filename="file""
..Content-Transfer-Encoding: binary..Content-Type: image/jpg..Content-Length: 27855..........JFIF....
```
* updated petstore sample
* removed line break
* apiInvoker : in getInstance, if instance is null initialize instance
build : replace the deprecated volley library by the android one
jsonUtil : Add in gsonBuider an adapter to deserialize Date class
And update petstore sample for volley library
* Update apiInvoker.mustache
Add a space after if, to stick to the code style.
* Update ApiInvoker.java
Add a space after if, in petstore samples, to stick to the code style.
* fix map usage in api generation #3694
* fix map usage in api generation #3695
* close impl gap between queryParam and formParam, to be more consistent
* use working copy constructor
* fix map usage in api generation #3694
* fix map usage in api generation #3695
* close impl gap between queryParam and formParam, to be more consistent
* python: Rework form data collection formatting support
* python: Add/fix support for query string collection formatting
* python: Add/fix support for path collection formatting
* python: Add/fix support for header collection formatting
* Make connection failures visible in Ruby SDK
The underlying HTTP library, Typhoeus, requires you to be explicit about
error handling. Unfortunately, this also means that we can't assume that
`response.success?` will be false only when the HTTP status code is not
a 200; it could also be false when the request fails (timeouts, TLS
verification issues, etc.). This commit adds explicit error handling for
these cases.
* Update samples
* python: Let logging format messages on demand
* python: Use six more
* python: Remove unused imports
* python: flake8 fixes
* python: Make examples compatible with Python 3
* python: Spelling fixes
This is useful when differentiating different error responses. Example:
if let e = error {
switch e {
case ErrorResponse.Error(400, _, _): responseLabel.text = "Unknown error"
case ErrorResponse.Error(403, _, _): responseLabel.text = "Not logged in"
default: responseLabel.text = "\(e)"
}
}
The existing error is straight from Alamofire and only includes the HTTP
status code in the body of the message (not broken out as a separate value).
It also does not include the response body, which may be useful.
* uncommented server.port property in application.mustache template and set it to serverPort value parsed from spec file
* update Petstore sample for Spring MVC and Boot
* Add maven-javadoc-plugin to all Java clients.
* Update sample petstores for other Java clients.
* Fix unknown parameter on api_client's update_params_for_auth method.
* Revert "Fix unknown parameter on api_client's update_params_for_auth method."
To be moved to a separate PR.
This reverts commit 1ee186694241bb6d9a0dccefcdca5afe3f5a1dd2.