* [aspnetcore] Use default rather than null in ctor
See original issue #3608
This adds same model constructor logic to aspnetcore as what was added
to csharp generator by PR #4145.
This doesn't include NancyFX because model construction relies more on
object initialization in that generator.
* [aspnetcore] ctor defaults + enum support
This follows up to #4145, and modifies model constructors to use
default(x) instead of initializing to nulls. default(x) works in all
cases using intuitive default values it is intended to support.
Example:
csharp> public enum Color { RED = -1, BLUE = 0, GREEN }
csharp> var color = default(Color)
csharp> color
BLUE
In the above example, The default of BLUE=0 is expected. For nullable
enums, this would be null as a default.
The aspnetcore generated code is also updated to support enums and
nested enums to account for changed to the petstore.yaml used to
generate the sample.
* [aspnetcore] Regenerate sample
Earlier CodegenProperty did not have title field.
'title' information of the property was lost while converting from Property to CodegenProperty.
This change fixes it.
* fixes#4432 Adding support for the modifier within the Jaxb XMLElement annotation. Updated README with JaxbAnnotations configuration option.
* #4432 Running the Petstore files
Allows users to specify 'nonPublicApi' additional property (and C#
client CLI switch) to reduce visibility of classes created by the
generator. This includes API and Models as well as supporting code like
ApiClient and other infrastructure.
The requirement is to support codegen generated code to be embedded
within other applications where the generated code is not intended to be
publicly consumable or publicy exposed. An example would be an SDK which
internally consumes an API via the generated code; we wouldn't want the
internal API implementation exposed as part of that SDK.
Reducing visibility of the classes effectively makes the entire
implementation internal, regardless of the public modifier on methods or
static members. To fully make all members internal it would require
explicit interface implementation, which is not ideal.
see #4401
After merging the fix with another C# change, noticed case sensitivity
issue for the true/false checks. Also noticed my original implementation
wasn't setting the default I- prefix as intended. This commit resolves
those three issues.
Per #4486, this allows user to specify the use of a standard or custom
prefix for interfaces. For C# based languages, this follows Microsoft's
Framework Design Guidelines and uses an I- prefix. However, to avoid
breaking changes with existing nancyfx generated code, the default is
unset.
The option supports true, false, or a custom prefix.
* 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
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.