This covers the usages that weren't fixed in #3825
Triple mustache is required because annotations may contain chars like
"=" that would be mistakenly encoded.
* 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
* add script to detect carriage return
* add check for generator as well
* add fail fast to travis config
* remove tab
* move scripts under bin/utils
* remove carriage return
* move scripts to bin/utils
* Fixes for issue 4226. Detects and warns about more than one inline object; sets discriminator on CodegenModel; Adds templates to other Java languages
Changes to be committed:
modified: modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java
modified: modules/swagger-codegen/src/main/resources/Java/typeInfoAnnotation.mustache
new file: modules/swagger-codegen/src/main/resources/JavaInflector/typeInfoAnnotation.mustache
new file: modules/swagger-codegen/src/main/resources/JavaJaxRS/typeInfoAnnotation.mustache
new file: modules/swagger-codegen/src/main/resources/JavaSpring/typeInfoAnnotation.mustache
* Add vendor extension for x-discriminator-value
Changes to be committed:
modified: modules/swagger-codegen/src/main/resources/Java/typeInfoAnnotation.mustache
modified: modules/swagger-codegen/src/main/resources/JavaInflector/typeInfoAnnotation.mustache
modified: modules/swagger-codegen/src/main/resources/JavaJaxRS/typeInfoAnnotation.mustache
modified: modules/swagger-codegen/src/main/resources/JavaSpring/typeInfoAnnotation.mustache
* Add "visible = true" to @JsonTypeInfo jackson annotations for Java languages
Changes to be committed:
modified: modules/swagger-codegen/src/main/resources/Java/typeInfoAnnotation.mustache
modified: modules/swagger-codegen/src/main/resources/JavaInflector/typeInfoAnnotation.mustache
modified: modules/swagger-codegen/src/main/resources/JavaJaxRS/typeInfoAnnotation.mustache
modified: modules/swagger-codegen/src/main/resources/JavaSpring/typeInfoAnnotation.mustache
* 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>
* updated to release versions
* fixed defaultValue objects to strings
* added top-level jackson version
* added missing dependency, removed from swagger-core
* Another approach: extending NodeJS server to support GCF.
This does not add a new language, but adding some client options
to support Google Cloud Functions (GCF).
* Add URLs for how to deploy the generated code.
Adds the client options help message and the README.md file.
* check if property is a BaseIntegerProperty. This can occur when format is not specified in Swagger definition
* Change coding style to be more consistent
* 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
* [html2] Clean up namespace issues in code samples
* pull c# and php package namespace from --additional-properties arg
phpInvokerPackage arg now sets the PHP namespace and packageName sets
the CSharp namespace. invokerPackage still works for Java and Android
namespace.
CodegenResponse's isListContainer property is always false for "array" types. Don't know where the check for "list" comes from but in CodegenOperation, there's a check for "list" and "array".
No mustache file makes use of isListContainer inside responses yet, so should not change any existing behavior.
* Change the value types in additionalProperties and dynamicProperties to Object instead of String.
Change methods that insert values to these maps to use Object as the type of the value instead of String.
* Fix run-all-petstore run: use toString instead of casting
* 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
* [JaxRS-CXF][bug #4330] support containers in return types
before this commit if a method returned a container (List or Map) of
THING (i.e. List<THING> or Map<String, THING>) the generated return type would
drop the container and only leave THING.
this commit fixes this issue such that the container type is properly
generated.
* regenerate jaxrs-cxf petstore sample
* 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
com.my.Generator.class.toString() returns "class com.my.Generator", and this value is then used in the javax.annotation.Generated annotation like that: @Generated(value = "class com.my.Generator").
Should use Generator.class.getName() instead, so we end up with @Generated(value = "com.my.Generator")
There is no good reason to use Boolean instead of boolean.
Using Boolean will lead to handling "null" state which is confusing.
This change removes changes the type of Boolean properties to boolean.
* 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
* Added support for string responses
When a method/URL/response is defined to return string:
- If no content types are define, default to 'text/plain' instead of
'application/json'
- Add response handler, that returns the reponse string as-is if response
content-type is 'text/plain'
* Removed use of unused tag vendor tag
- The tag was vendorExtensions.x-codegen-response.isPrimitiveType
* 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
* Add Error to the list of reserved words that must be escaped for Class-generation
This fixes a part of #2456.
* add in special casing for the model names to not clobber existing language type names
* address formatting issues to be in line with language convention
* 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
* #3908 make a copy of vendorExtensions map instead of copying the
reference
* using 4-space instead of tab.
* make a copy of vendorExtensions map instead of copying the reference
* 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
Supports multi-level inheritance to avoid having the variables from
the parents of level > 2
This commit also fixes the comparison of the variables when skipping
the variables in the children classes by only comparing their names
(in some cases some parent variables were present in children classes)
Signed-off-by: Vincent Giersch <vincent@giersch.fr>
* remove php apache license
* remove license in sample code, update nodejs to use unlicnese
* remove license from jaxrs generator
* remove license from server generator
* update pom.xml for jaxrs resteasy joda server
* 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
* Added switch to config to toggle use of yaml base path as module paths
* NancyFX template updated to return collections as array to allow framework to find views by type name for text/html mime type
* Added some more parser fixes for NancyFX
* Refactored collection parsers in Parameters.cs and changed some to return nullable collections to match the parameter mappings in AbstractCSharpCodegen
* re-ran petstore build
* hashCode and equals support for jdk6 for jersey2
* supportJava6 moved to the base abstract class to support server side code generation,
supportJava6 flag was added to the server side model classes generators,
licenseInfo ttemplate was added to JavaJaxRS section,
javaJaxRS templates jdk6 suport was added,
shouldOverride method was commented out to allow server classes to be overriden - what if new methods or signatures changes?
* fix for the build.
* supportJava6 moved to the base abstract class to support server side code generation,
supportJava6 flag was added to the server side model classes generators,
licenseInfo ttemplate was added to JavaJaxRS section,
javaJaxRS templates jdk6 suport was added,
shouldOverride method was commented out to allow server classes to be overriden - what if new methods or signatures changes?
* fix for the build.
* Merge remote-tracking branch 'remotes/origin/master' into jdk6-jersey2-support
Conflicts:
modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java
modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java
modules/swagger-codegen/src/main/resources/Java/pom.mustache
* add msf4j author
* [Java] Fix outputFolder in java-related server stub generators (#4076)
* fix outputFolder in java-related server stub generator
* fix style in JavaJAXRSCXFCDIServerCodegen
* hashCode and equals support for jdk6 for jersey2
* supportJava6 moved to the base abstract class to support server side code generation,
supportJava6 flag was added to the server side model classes generators,
licenseInfo ttemplate was added to JavaJaxRS section,
javaJaxRS templates jdk6 suport was added,
shouldOverride method was commented out to allow server classes to be overriden - what if new methods or signatures changes?
* fix for the build.
* supportJava6 moved to the base abstract class to support server side code generation,
supportJava6 flag was added to the server side model classes generators,
licenseInfo ttemplate was added to JavaJaxRS section,
javaJaxRS templates jdk6 suport was added,
shouldOverride method was commented out to allow server classes to be overriden - what if new methods or signatures changes?
* Merge remote-tracking branch 'remotes/origin/master' into jdk6-jersey2-support
Conflicts:
modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java
modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java
modules/swagger-codegen/src/main/resources/Java/pom.mustache
* Merge remote-tracking branch 'remotes/origin/master' into jdk6-jersey2-support
Conflicts:
modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java
modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java
modules/swagger-codegen/src/main/resources/Java/pom.mustache
* 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
* Newline escaping disabled
Newline escaping disabled for HTML and HTML2 generators. Escaping
failing Markdown processors to work correctly on descriptions
* HTML examples updated
* fix NancyFX string parser
parser needs to access the Value parameter to enable the direct cast at line 102 when handling string parameters
* Updated nancyfx sample
* Added switch to config to toggle use of yaml base path as module paths
* 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
* fix NancyFX string parser
parser needs to access the Value parameter to enable the direct cast at line 102 when handling string parameters
* Updated nancyfx sample
* added method summary under the method name
* added batch file for html2 generation on windows
* regenerated html2 example
* changed the html2 windows batch to use yaml instead of json and regenerated sample
* fixed encoding issues
* [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
This moves previous aspnet5 functionality to aspnetcore, aspnet5 now
derives from the aspnetcore generator and logs a warning that it's
deprecated.
This will help resolve any confusion because ASP.NET 5 is terminology
referring to the project of around a year ago. ASP.NET Core 1.0 is the
new name for the technology, and further enhancements should target .NET
Core 1.0 rather than any old vNext or preview stuff.