Commit Graph

9706 Commits

Author SHA1 Message Date
Jim Schubert
2c9f98ce38 [csharp] clean boolean additional properties 6784 (#6899)
* [csharp] Convert "false" properties to booleans

It appears as though "false" strings in additionalProperties are no
longer treated as false booleans. This may be an issue elsewhere, but a
simple fix is to always explicitly set the boolean value in a generator
class back to the additionalProperties map to convert boolean Strings to
boolean Objects.

* [nancyfx] Clean up async default option handling

* [nancyfx] Include asyncServer=false in sample script

* [csharp] Regenerate samples

* [csharp] Resolve .net 4 generation issues

Some functionality is missing from .NET 4.0, such as IReadonlyDictionary
and Type.GetTypeInfo().

This commit resolves compilation of generated .NET 4.0 code, requiring
no conditional versioning of Newtonsoft.Json.

* [csharp] Regenerate .net 4.0 sample

* [csharp] Resolve .NET 4.0 sample compile

Sample build.sh wasn't accounting for targeting different FCL correctly.
That is, when passing "net40" to the -sdk option, it would use the
default -sdk:4 and -langversion:6. These don't necessarily match with
what is installed on a machine with only .NET 4.0 (which is our targeted
use case here).

To resolve, we need to define another version-specific value for passing
to the mcs -sdk option (see man mcs for details).

This option currently isn't overridable in the client codegen class.
Also, langversion is set specifically to the version of C# available to
the targeted SDK version. If there is need, we may extend this to
something like:

langversion=${MCS_LANG_VERSION:-6}

To allow users to run as:

   env MCS_LANG_VERSION=5 sh build.sh

I haven't done this because I doubt there's much of a use case via this
script. I'm assuming most consumers will build via IDE or MSBuild.

* [csharp] Revert bin/csharp-petstore.sh to 3.5

* [csharp] Regenerate .NET 3.5 sample

* [csharp] Resolve nuget issue with existing files

* [csharp] Update -all.sh, regenerate samples
2017-11-15 22:36:37 +08:00
wing328
d676cd12c9 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-11-15 21:46:08 +08:00
Atanas Bozhkov
970de01bdf [Swift4] Add throw to reserved words (#6952)
* * Added `throw` to Swift4 Reserved words.

* * Regenerating Swift4 Petstore project
2017-11-15 21:45:30 +08:00
James Ebentier
4e482eef17 add a docker build tag for pushing docker image instead of just latest (#6837) 2017-11-15 21:37:26 +08:00
William Cheng
744c7d904a
remove spaces, empty lines from qt5cpp client (#6956) 2017-11-14 23:28:06 +08:00
Charles Capps
47f1865e69 [Java][google-api-client] Fix minor bugs in google api client (#6951)
* Fix minor bugs in google-api-client templates

* Update samples
2017-11-14 12:02:59 +08:00
Keni Steward
d719daab22 Updated swagger-ui wget url to https (#6954) 2017-11-14 11:24:50 +08:00
Dawid van Graan
5af788cb9f [Swift4] Allow for custom dateformatter to be used (#6672)
* Add a custom dateformat to be set

* Samples updated

* Update CodableHelper.swift

Change to correct format: decoder.dataDecodingStrategy = .base64

* Update CodableHelper.mustache

Add `decoder.dataDecodingStrategy = .base64` back

* Update CodableHelper.swift

Fix `decoder.dataDecodingStrategy = .base64`

* Update CodableHelper.swift

Fix `decoder.dataDecodingStrategy = .base64`
2017-11-13 22:15:43 +08:00
Jon Schoning
b3133a2d74 [haskell-http-client] fix bug when generating models-only (#6931) 2017-11-13 20:44:46 +08:00
wing328
473dfded21 fix typo: crediential => credential 2017-11-13 18:42:23 +08:00
William Cheng
dff463f2fc
minor typo fix 2017-11-13 18:35:47 +08:00
Jim Schubert
28e2fcee78 [csharp] fix enum serialization of first value (#6873)
* [csharp] Treat enum models consistently

C# works differently from most languages in that enums are not
considered objects. This means default(EnumType) will choose a default
of the first enum option. This isn't desirable because it breaks the
required = false functionality of swagger specs, which defines a
property which isn't required to exist in the message body.

Rather than force consumers to use enum values such as UNSPECIFIED, UNKNOWN,
NOT_SET, etc... we can treat enums as primitives. This means any
non-required enum will become Nullable<EnumType> regardless of whether
it is defined as an inline enum or a referenced enum model.

* Categorizing C# integration test for enums as general

* [csharp] Remove enum-ref integration test

* [csharp] Clean up general enum support integration test, validate different enum usage cases.

* [csharp][all] Assign one-based int to string enums

The EmitDefaultValue=false for string based enums will prevent the first
enum value from being serialized, because as 0 it is considered the
default.

This commit assigns an explicit numerical value to all non-integer
enums. This assignment has no effect on the
serialization/deserialization values, and only assigns the compiled
integer.

NOTE: This will have an effect of requiring recompilation of any code
that references the client/server models. This is because:

    public enum Pet { Available }

Source files referencing Pet.Available as defined above will have a
constant 0 in place of the enum value.

    public enum Pet { Available = 1 }

Source files referencing Pet.Available as defined above will have a
constant 1 in place of the enum value.

After compilation, Pet.Available in both instances lose their semantic
values and refer to the byte representation of their integral values.

For more info, see
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/enum
2017-11-13 16:02:03 +08:00
Akihito Nakano
9ca9887de4 [PHP] Improve docs and README (#6935)
* Fix wrong client class, add details about client

* Improve example for Configuration

* camelcase

* Improve README like api doc

* Update samples
2017-11-13 13:56:45 +08:00
Gabriele Bonetti
62444a7aaf Binary mode for file deserialization in python (#6936)
* use wb mode in file deserialization

* add auto generated files from security/python-petstore.sh
2017-11-13 12:50:10 +08:00
wing328
90a0b7a7e2 add python tornado test to travis 2017-11-13 12:05:18 +08:00
Tomasz Prus
4e967e696c [Python/tornado] add integration tests and fix bugs (#6925)
* tests: add integration test for python-tornado

* [python-tornado-client] tests: increase timeout for test_upload_file

* [python-tornado-client] fix: tornado client passes tests
2017-11-13 12:03:55 +08:00
Alexandre Demode
63d28cf75b Fix PHP passes response body to ApiException (#6923) 2017-11-13 11:30:46 +08:00
Shuma Yoshioka
053061ec9f [TypeScript][Node] Resolve TS2532 error (#6932)
* [TypeScript][Node] Resolve TS2532 error

* Run `bin/typescript-node-petstore-all.sh`

* Run `bin/security/typescript-node.sh`
2017-11-13 11:23:56 +08:00
wing328
4a38ee283c Merge branch 'test_php' 2017-11-12 23:23:23 +08:00
wing328
f34aca62f6 skip "all" shell script 2017-11-12 22:42:02 +08:00
wing328
2ef65d1488 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-11-12 22:23:30 +08:00
wing328
444a05ce21 minor formatting change 2017-11-12 22:21:54 +08:00
wing328
c515dd82ff Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-11-12 22:16:37 +08:00
etherealjoy
ca58053339 Fixes Issue #6841, Map for accessing additionalProperties is generated. (#6886)
The issue #6884 is still present and requires fixing outside of mustache file as well.
2017-11-12 22:16:26 +08:00
William Cheng
6739481a5d
add tsloughter as owner erlang 2017-11-12 22:07:12 +08:00
Tristan Sloughter
b9651e5775 WIP: initial commit for Erlang client generator (#6502)
* WIP: initial commit for Erlang client generator

* add models types and function type specs

* fix type specs when models are the type and support QS lists

* make method lowercase in postprocessoperations

* add model encode function

* add erlang client sample

* add windows client sample script

* proper return type spec and handle return error messages
2017-11-12 22:02:05 +08:00
wing328
0d55c12a63 add back php client test 2017-11-12 21:59:47 +08:00
William Cheng
fd220147ae
Switch Travis image from MacOS to Linux (#6937)
* remove jdk7 check

* comment out some installation

* update npm

* comment out ts angular tests

* restore ts angular2 test

* restore bash test

* add back new config, clean up commented items
2017-11-12 21:50:11 +08:00
William Cheng
d76e37277a
add link to ebook 2017-11-11 14:51:35 +08:00
Greg Marzouka
f921f4f4da [Scala] Default case class Option types to None for non-required fields (#6790)
* [Scala] Default case class Option types to None

* Update Petstore sample
2017-11-10 15:57:40 +08:00
Gustavo Paz
b404dafa02 Issue 6694 2.3.0 (#6845)
* The get method template is modified to return the value of the enum instead of the enum itself.

* Update of the Petstore CXF server sample

* Update of the Petstore CXF client sample

* Update of the Petstore CXF server annotated base path sample

* Update of the Petstore CXF server non spring application sample
2017-11-10 15:32:05 +08:00
Andrew Norman
372a08763d adding "Read Timeout" getters and setters for the Jersey and OkHttp (#6853)
* adding "Read Timeout" getters and setters for the Jersey and OkHttp
based ApiClients

adding "Write Timeout" getters and setters for the OkHttp based
ApiClient

adding tests for the OkHttpClient covering the new getters and setters

* generated files from the bin scripts
2017-11-10 12:12:40 +08:00
wing328
141fc7e8c7 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-11-09 22:41:22 +08:00
afrolovsky
9a44512d03 @JsonProperty annotation for jaxrs-spec server model classes (#6911) (#6916) 2017-11-09 21:46:26 +08:00
wing328
3355c92970 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-11-09 21:46:00 +08:00
wing328
9dea435104
add kenjonese-cisco to python tech committee 2017-11-09 21:43:47 +08:00
François Rosé
485b186129 [CppRest] Unique header guards (#6904)
* [CppRest] Generate unique header guards based on the package names.

* [CppRest] Update cpprest petstore client sample.
2017-11-09 17:59:45 +08:00
François Rosé
7a83081f18 [CppRest] Remove U macro (#6903)
* [CppRest] Replace U macro with conversion function for default string values.

* [CppRest] Replace U macro with conversion function in templates.

* [CppRest] Update cpprest petstore client sample.
2017-11-09 17:58:21 +08:00
Jim Schubert
92ac1edd78 [csharp] Treat enum models consistently (#6851)
* [csharp] Treat enum models consistently

C# works differently from most languages in that enums are not
considered objects. This means default(EnumType) will choose a default
of the first enum option. This isn't desirable because it breaks the
required = false functionality of swagger specs, which defines a
property which isn't required to exist in the message body.

Rather than force consumers to use enum values such as UNSPECIFIED, UNKNOWN,
NOT_SET, etc... we can treat enums as primitives. This means any
non-required enum will become Nullable<EnumType> regardless of whether
it is defined as an inline enum or a referenced enum model.

* Categorizing C# integration test for enums as general

* [csharp] Remove enum-ref integration test

* [csharp] Clean up general enum support integration test, validate different enum usage cases.
2017-11-09 17:14:47 +08:00
wing328
8b251555ac update php symfony petstore, remove spaces in empty line 2017-11-09 16:36:25 +08:00
cydrickn
fbc28797d1 [PHP][Symfony] Update Controller.mustache (#6842)
* Update Controller.mustache

* Use debug instead of environment
2017-11-09 16:29:41 +08:00
Jinkui Shi
92a1c3a449 [issue-6860] fix NPE of Could not generate api (#6868) 2017-11-07 15:46:20 +08:00
Keni Steward
39a9c5587f [Typescript][Node] Fixes inccorect enum generation for enumsMap when Array<Enum> is defined fixes part of Issue #5681 (#6862) 2017-11-07 01:19:58 +08:00
Keni Steward
626fa7531b [TypeScript][Angular] Attempts to fix issues that causes enums that are not generated with a class to not generate correctly (#6833)
* Attempts to fix issues that causes enums that are not generated with a class to not generate correctly

* Fixed issue with incorrectly generating enums
2017-11-05 16:34:24 +08:00
Jeffrey Slort
cf813f5c8e Feature/replace isomorphic fetch with portable fetch (#6739)
* Replaced isomorphic fetch with portable fetch

* Ran scripts in bin

* reference custom.d.ts in api.ts

* ran scripts and added custom.d.ts files to git

* Ran scripts in bin after merge

* regenerated security tests
2017-11-05 15:37:54 +08:00
wing328
2bce479c1c
minor code format enhancement to ts angualr (#6888) 2017-11-05 12:05:45 +08:00
wing328
37184a1cd8
Minor fix to body parameter in required parameter list (#6885)
* minor fix to required parameter list

* better if then else block
2017-11-05 10:22:36 +08:00
Jon Schoning
cd1c2b13e3 [haskell-http-client] refactor & promote accept mimetype to request; simplify templates (#6866)
* add AuthMethodException

* rename cli prop

* simplify templates
2017-11-05 01:41:53 +08:00
Meindert Deen
a5586044cd Implemented fix for #6006. Mime-type support (#6751)
* Implemented fix for #6006. Mime-type support for accepts and
content-type.

* Review comments of @macjohnny incorporated

* merge with latest and retest

* merge with latest and retest. Now correctly generated with new Maven build
2017-11-05 00:26:42 +08:00
Kenny Jones
b6699f6068 [python] Convert unicode to six.u (#6881)
`unicode` does not exist in py3, therefore since six is already imported
switch to using `six.u` so that `unicode` is used on py2 and `str` is used
on py3.
2017-11-04 23:24:51 +08:00