In the convenience class defined for generating a Map of query parameters, the
parameter name was mistakenly being set to the Java variable name, not the
actual parameter name. These are often the same, but can be different in the
case of multi-word parameters, such as in the sample API's `enum_query_string`
vs `enumQueryString`.
* Update samples for java/jersey2-java6.
* Let the sample generation script set the right name for jersey2-java6.
This is the equivalent change to #5095, for jersey2-java6.
* Update samples for Java/Jersey2-java6.
* use builder pattern for operations
* @QueryMap parameter only for query parameters
The previous iteration had replaced all parameters (body, path, query, etc)
within a single @QueryMap. But Feign only supports this style of parameter
passing for query parameters. Besides, for the case of a body parameter (like
soxhlet uses) it only added extra verbosity. With this change, the query
parameters are gathered together in a single @QueryMap and the other parameters
are left alone.
* Adding template for generating test code
* Make javadoc consistent with rest of file's conventions/indents
* Update samples
The files in src/main were generated by running
$ bin/java-petstore-feign.sh
The files in src/test were manually fixed.
* Correct capitalization of @QueryMap class in feign
Adds a field operationIdCamelCase (a la operationIdLowerCase) to the
CodegenOperation container and uses it in the feign-generated classes
with @QueryMap parameters. Also re-generated the feign samples.
* Adding hyphen to javadocs for extra readability.
* Adding (not replacing) api method with @QueryParam overload.
In order to keep backwards compatibility, switched to adding a new method to
the interface instead of replacing the old call.
* Adding newline to generated source for readability.
* fix#2159 dataformatter error for iOS Swift
When trying to parse 24-hour time to 12-hour time, date formatter throws fatal error.
It's caused by lack of settings locale for date formatter.
* update sample code
* [CsharpNetStandard] Added C# .NET Standard Client Generation
Added language CsharpNetStandard.
Everything copied from csharp Client Generator.
Dependancies switched from Restsharp to Restsharp.Portable.
Changes made where nececary to replicate Restsharp functionallity.
Project type changed to .NET Standard protable library.
* [CsharpNetStandard] Removed client prop validation due to incompability
* [CsharpNetStandard] Minor fixes
Changed leftover RestSharp.Method to Method
Changed to .Net Standard 1.3 for compability reasons
Changed excludeTests to default to true due to tests not being implemented yet
Removed unnecessary targetFramework property
Removed leftover UWP stuff
* [CsharpNetStandard] More fixes
Added correct dependencies to Readme
Added correct supported frameworks to Readme
Added slightly better placeholder for installation instructions in Readme
Removed leftover dependencies from project.json
Removed leftover SupportsAsync stuff
Removed references to build.bat/-.sh since they're not yet being generated
Todo implement test generation
* [CsharpNetStandard] Added forgoten git_push.sh
* [C#-netstandard] Renamed option to csharp-netstandard
Also added .bat file for test generation
* [C# Net Standard] fixed path in .bat file
* [C# NET Standard] fixes to enum generation
Fixed issues with enum generation due to tired programmer
* [C# NET Standard] Generated sample client library
Sample library generated
Fixes:
Class actually works again
.bat - minor inconsistency fixed
* [C# NET Standard] Error corrected in how timeout is set
Configuration Timeout property changed to TimeSpan type and code corrected around that
* [C#] Merged .NET Standard generator into csharp generator
Functionallity of csharp-netstarndard generator has been moved into standard csharp generator under the targetFramework option as "v5.0"
* Fix (partially) #4898 for groovy.
This also adds some TODOs for the missing path, form and body parameters.
* Update Groovy samples (after partial fix for #4898)
* 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.
This adds a `saveCookies` boolean flag to ApiClient. If set to true,
the client will save and return cookies to the server.
This is useful for supporting @SessionScoped beans in Java servers.
Works both in Node.js desktop apps, and in the browser.
* Triple quote python strings in defaults
When the model contains a string with a default value with new lines in
it, simply quoting generates invalid python code. Using triple quotes
for all string defaults makes sure the generated code will be a valid
python string.
Fixes#4862
* Wrap default string in triple quotes when it contains new lines
* Add newly generated python sample files
* Port the optional/enum template logic from async-scala to the regular scala client
* oops, accidently pulled template from akka-scala which has custom logic for enum
Just going to avoid enum for now, considering I'm not sure what scala client
will be official
* Update tests to use option
Superagent doesn't encode form parameters properly. For example it doesn't encode objects which contain array. The following is a failed test case:
var my_opts = {
'storyId': 65441,
'id': [56, 352]
};
* Removed trailing spaces
* Fixed autocomplete support for bash-completion < 1.4
* Added mime type autocomplete for Zsh
* Fixed Bash url autocompletion
* Fixed Zsh space after operation arguments and added trim to descriptions
* Added generation of Dockerfile for packaging Bash rest clients
* updated test samples for Bash client generator
* issue 3914, removed logic that remove header parameters. update template files to handle header parameters in the same manner as other parameters
* update swift and swift3 samples
* Fixed issue #4665 [go] required object parameters are marked omitempty.
* Run ./bin/go-petstore.sh as suggested by @wing328.
Please note, that there are quite few changes, that doesn’t come from the diff I’ve applied. Seems the script wasn’t run on the previous commit.
* Add elixir client
* Add test for elixir client
* Add shell script for generating sample codes for elixir client
It just copied from bin/bash-petstore.sh
* Make elixir-petstore.sh to generate sample codes for elixir client
* Add sample codes for elixir client
* 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
* [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