Commit Graph

12308 Commits

Author SHA1 Message Date
Jim Schubert
a96ab1cf9d
[core] GeneratorSettings, WorkflowSettings, and cleanup in CodegenConfigurator (#2946)
* Introduce GeneratorSettings + cleanup

GeneratorSettings is an immutable settings object, intended to limit the
manipulation of generator settings.

To move to GeneratorSettings, lots of modification was done to
CodegenConfigurator. The goal  here is that CodegenConfigurator
would create the contextual information required to initiate a
generator run:

* GeneratorSettings
* Workflow related settings
* Configuring "system" GeneratorProperties (ThreadLocal properties)
* Deserializing from file to config object
* Input spec document (OpenAPI, intending to target others)

ClientOpts was generally unused, and the few places it was being used
have been updated to pass the properties to
codegen.additionalProperties.

* Add sanity to system properties

The -D argument for the generate command is an application argument
which is easily confused for Java System Properties. This isn't the
case, as setting values here doesn't update the configuration in
System.getProperties().

This adds a warning and deprecation to that option, as defining these
values as system properties will also continue to work as expected. This
makes the -D application argument redundant and confusing.

* Contextualize generator/workflow settings

This splits settings relevant to generator configuration (the what) and
workflow configuration (the how) in an attempt to make configuration
easier to conceptualize.

* Update Gradle task w/ CodegenConfigurator setters

* Remove -D usage in scripts

* Add -p option for additional properties

* Regnerate samples
2019-06-07 13:07:52 -04:00
William Cheng
7e457f7e41 sync master 2019-06-03 00:32:13 +08:00
William Cheng
8d3a1a5add Merge remote-tracking branch 'origin/master' into 4.1.x 2019-06-03 00:06:43 +08:00
William Cheng
b74fa4458d
Update compatibility table
Update compatibility table
2019-06-03 00:03:16 +08:00
Chris Couzens
522a1a2372 Ruby client: escape path parameters (#3039)
* Ruby client: escape path parameters

Path parameters should be escaped when encoded into the path.

In the path '/pet/{petId}' let's pretend petId is a string instead of a
number.

If the user uses "Bobby" as the petId then they correctly get the path
'/pet/Bobby'.
But if they put 'Bobby/Tables' as the petId then they used to get the
path '/pet/Bobby/Tables' which will be interpreted by the server as a
different route.

Using CGI::Escape they now get '/pet/Bobby%2FTables' which is correct.

* Ruby client- regenerate further files

Thank you @autopp for noticing I needed to update
`samples/openapi3/client/petstore/ruby`.

Regenerated by running `bin/openapi3/ruby-client-petstore.sh`.

PR #3039
2019-06-03 00:24:30 +09:00
Jim Schubert
f667effa76
[gradle plugin] Release 4.0.1 fixes (#3051)
Fixes issues found during the 4.0.1 release
2019-06-01 23:36:17 -04:00
Jérémie Bresson
dc81574f2b Update version to 4.0.2-SNAPSHOT (#3047)
* Update version to 4.0.2-SNAPSHOT

* Update samples

* Change AppVeyor script (test of gradle sample)

* Fix release version bump script (gradle plugin, sample poms)

* Include sonatype snapshots in maven examples which reference 4.0.2-SNAPSHOT
2019-06-01 21:32:44 -04:00
sunn
7ecc99192d Map number to double time since float is also parsed as double in Qt5 C++ (#3046) 2019-05-31 19:23:07 +02:00
William Cheng
39648ee3a7
Prepare 4.0.1 release (#3041)
* update snapshot version

* update to 4.0.1
2019-05-31 23:42:55 +08:00
Jim Schubert
6a1fc51069 [gradle] Reworking publishing pipeline (#2886)
* [gradle] Reworking publishing pipeline

TravisCI proxies separate external requests with different orginating IP
addresses, while Sonatype associates artifacts for auto-generated
repositories by IP address. This leads to many gradle deploys from CI
resulting in "split" staging repositories with no way to combine in
Sonatype Nexus.

This introduces a workflow which should resolve this issue on the next
revision release. Specifically, nexus-publish-plugin is included to
create singular staging repositories from TravisCI and
gradle-nexus-staging-plugin is included to auto-release and promote
this repository.

NOTE:
We need to publish via publishPluginMavenPublicationToNexusRepository,
because publishToNexus will publish _all_ publish-related tasks,
including the one intended only for the Gradle Plugin Portal.

Tested in standalone open source Nexus Repo Manager, which doesn't
support the staging plugin. So, only SNAPSHOT workflow has been
validated locally.

* Change the 'publish' task to 'publishToMavenLocal' in the helper pom.xml

* Add condition on signing and be explicit about sources/javadoc artifacts

* Call close/closeAndReleaseRepository

* Reuse same closeAndReleaseRepository for SNAPSHOT + releases using a task guard, and publish to Gradle Plugin portal only on tagged build.

* Add v prefix for tag check.
2019-05-31 20:43:21 +08:00
Jan Buchar
c509d9897a [typescript-fetch] Fix uploading files (#2900)
* [typescript-fetch] Fix uploading files

* Check for Blob instead of File

* Update samples

* Update samples

* Update samples

* Update samples

* Regenerate samples

* Bug

* Manually fix samples

* Implement support for Buffer and Blob in a backwards-compatible way

* Rework how blob and buffer instance checking works

* Check for Blob/Buffer existence properly

* Avoid using Buffer and Blob in type declarations

* Remove Buffer support

* Update samples/client/petstore/typescript-fetch/tests/default/test/PetApi.ts

Co-Authored-By: Esteban Marin <estebanmarin@gmx.ch>

* Update samples/client/petstore/typescript-fetch/tests/default/test/PetApi.ts

Co-Authored-By: Esteban Marin <estebanmarin@gmx.ch>
2019-05-31 14:15:32 +08:00
Deven Phillips
ddf21f0ca5 Resolves #2962 - Add properties config to Maven parameters (#2963)
* Resolves #2962 - Add properties config to Maven parameters

* Fixed formatting

* Fixed formatting

* Fix missing hyphen

* Added propery for `engine` parameter
2019-05-31 09:43:57 +08:00
Michael Cristina
a2e84c348c fix(golang): Check error of xml Encode (#3027) 2019-05-31 00:50:34 +08:00
Mateusz Szychowski (Muttley)
87adba9c4b [C++][Restbed] Add handler callback methods (#2911)
* [C++][Restbed] Add handler callback methods

* [C++][Restbed] Update Petstore sample
2019-05-30 16:45:28 +02:00
sunn
aae97638a9 Remove null checks for C# value types (#2933) 2019-05-30 18:06:42 +08:00
Guillaume SMAHA
20b8eff6e3 [python-server] Support python 3.7 for all server-generators (#2884)
* Support python 3.7 for all server-generators

Signed-off-by: Guillaume Smaha <guillaume.smaha@gmail.com>

* Rename typing_patch.py to typing_utils.py

* Renaming typing_patch.mustache to typing_utils.mustache

* Fix comparaison in typing_utils.is_dict for python3.7
2019-05-30 11:36:06 +08:00
Kevin Kirsche
14118807ba Use golang's provided method names (gin) (#2983)
* Use golang's provided method names (gin)

This commit modifies the gin template for the router to leverage the http constants for method types as defined by RFC 7231 section 4.3. These are documented on:

https://golang.org/pkg/net/http/#pkg-constants

This removes the need for the `strings` dependency and does not require any new dependencies, as `net/http` is already imported.

* Remove strings dependency which is no longer used

* Update samples
2019-05-30 01:48:22 +08:00
Sai Giridhar P
e3bc228dd5 [python] Adding constructor parameters to Configuration and improving documentation (#3002)
* feat(python): Updated configuration's constructor and documentation

* feat(python): Updated documentation

* feat(python): Updated pet project

* feat(python): Updated pet project

* feat(python): Fixing host

* feat(python): Updating pet project

* feat(python): Fixing indentation
2019-05-30 00:50:26 +08:00
William Cheng
6742302922
Add new option to maven plugin's readme (#3025)
Add new option to maven plugin's readme
2019-05-29 21:59:38 +08:00
azizamaan
91af76700e Engine param in maven plugin. (#2881) 2019-05-29 21:31:21 +08:00
Ingvi Rafn
8a6d996c4f Added support for patterns on model properties (#2948) 2019-05-29 21:30:25 +08:00
Sai Giridhar P
40ec016c87 [csharp] Make API response headers dictionary case insensitive (#2998)
* fix(response-headers): Making response headers case insensitive

* fix(response-headers): Making response headers case insensitive

* feat(csharp): Headers case insensitive

* feat(csharp): Making API response's headers case-insensitive

* feat(csharp): Indentation fix

* feat(csharp): Indentation fix

* feat(csharp): Adding generator's documentation
2019-05-29 19:39:54 +08:00
Sai Giridhar P
7756296c25 [Python] ModuleNotFoundError when packagename contains dots (#2992)
* feat(python): Support package names with dots

* feat(python): Fixing tests

* feat(python): Adding comment

* fix(python): Fixing indentation

* fix(python): Fixing indentation
2019-05-29 19:38:42 +08:00
Erik Timmers
44e4dc3ff4 Add support for the URI format (#3023)
* Add support for URI formats

* Set URI type for all generators
2019-05-29 19:35:30 +08:00
Sai Giridhar P
f93e75b078 [java-okhttp]: Make example snippets code compilable (#3016)
* fix(okhttp-gson): Make example executable

* fix(okhttp-gson): Make example executable

* fix(okhttp-gson): Make example executable

* fix(okhttp-gson): Updating pet project

* fix(okhttp-gson): Updating parcelable project

* fix(okhttp-gson): Using {{{}}}
2019-05-29 00:58:23 +08:00
Sai Giridhar P
0a037ae111 [csharp] Making example code snippet compilable (#3019)
* fix(okhttp-gson): Updating example

* fix(csharp): Updating example

* fix(csharp): Updating pet project

* fix(csharp): Updating example
2019-05-29 00:57:06 +08:00
Sai Giridhar P
499c8ac5c1 [java-okhttpgson]: Include API's Http response codes and their corresponding description and response headers in the documentation (#2995)
* fix(okhttp-gson-java): Adding response headers on api_doc.mustache

* feat(okhttp-gson): Adding Http response headers to docs and javadocs

* feat(okhttp-gson): Included dots in custom tage

* feat(java-okhttpgson): Updating pet project

* feat(java-okhttpgson): Updating other pet project
2019-05-29 00:55:59 +08:00
Erik Timmers
38b1fe2d36 Add support for enums in Elm operations (#2982) 2019-05-28 23:00:04 +08:00
Vincent Devos
d748312818 [KOTLIN client] fix Moshi (Serializer/Deserializer) duplicated (#3013) 2019-05-28 15:15:06 +08:00
Jaumard
d1043c910c fix jaguar wrong import on object (#3000) 2019-05-28 15:10:35 +08:00
William Cheng
60e6371fc5
fix class hardcode to pet (#3014) 2019-05-28 00:45:01 +08:00
Gualtieri Mario
50878fbc2e [TS][Inverisify] Adding support for RxJS 6 (#2793)
* Add support to http patch method

* Add support to rxjs6

* Align sample

* Add sample for openapi3

* Change usage of single quote to use only double ones

* Fix wrong changes of typescript-angular package.json template

* Add `map` keyword inside reservedWords

* Add typescript-inversify inside README


Add typescript-inversify inside README

* fix merge issue, update petstore

* update doc
2019-05-27 23:33:07 +08:00
Esteban Marin
5167955ee0 Create FUNDING.yml (#3008) 2019-05-27 22:17:21 +08:00
William Cheng
b88b1d656a
Add auto-generated tests and travis config to Dart clients (#3006)
* add auto-generated tests and travis config for dart

* improve tests

* fix tests

* add test, travis files to dart jaguar generator
2019-05-27 18:44:57 +08:00
William Cheng
5c6824f569
update feign to the latest stable version (#2999) 2019-05-27 15:11:02 +08:00
vellengs
e4f56d5906 To fix conflict params name 'url' (#2921)
* To fix conflict params name 'url'

Sometime we have api params named url that will conflict with imported module url named url.

* run samples

* run samples

* update samples

* update ts axios petstore all
2019-05-27 09:42:41 +08:00
Sai Giridhar P
d0a8d68512 [csharp-netcore] Enabling XML documentation on csharp-netcore client (#2996)
* feat(csharp-netcore): Enabling xml documentation

* feat(csharp-dotnetcore): Updating pet

* feat(csharp-netcore): Updating csproc with documentation file

* feat(csharp-netcore): Updating netcore project's csproc

* feat(csharp-netcore): Updating pet project

* feat(csharp-netcore): Updating pet project

* feat(csharp-netcore): Updating ensure-up-to-date script
2019-05-27 01:22:31 +08:00
William Cheng
ff1c7c87ef
update jackson joda version, samples (#3005) 2019-05-27 00:26:24 +08:00
fj-roman
7109f5fb3b [kotlin] add testFolder configuration for kotlin (#2975)
* add apiSuffix configuration

* refactor the global option apiSuffix to kotlin specific feature

* add testcase

* add testFolder for kotlin gen

* add basic api_test.mustache template

* add api_test,mustache

* add tests

* improve usage of file separators

* replace defined file separator into os specific separators

* improve test templates and kotlin-springboot sample

* add test dependecies into gradle template

* add newline into template file
2019-05-26 17:12:31 +08:00
sunn
2e6b911022 Set default base path and change constructor to const ref (#2973) 2019-05-26 17:03:48 +08:00
William Cheng
2bc9592bd5
Revert "Add auto-generated tests and travis config to Dart clients (#2909)" (#3001)
This reverts commit dfda6655ec.
2019-05-26 01:50:31 +08:00
William Cheng
dfda6655ec
Add auto-generated tests and travis config to Dart clients (#2909)
* add auto-generated tests and travis config for dart

* improve tests

* fix tests
2019-05-25 22:52:30 +08:00
William Cheng
d243a6b96d
Update jackson-databind to address security issues (#2993)
* update jackson-databind to address security issue

* update java vertx client dev, sample

* update dep, samples

* update retrofit play2 dep
2019-05-25 18:24:37 +08:00
Vincent Devos
c4bf6588aa [Kotlin client] Improve JSON parser (#2981)
* [Kotlin client] Improve JSON parser

* fix import in model for threetenbp date
2019-05-24 17:11:26 -04:00
kroegerama
213c015c95 improve Kotlin code quality (#2988)
* improve Kotlin code quality

* regenerate kotlin samples
2019-05-25 00:18:25 +08:00
Shenghan Gao
268196e7f6 [Python] Remove unnecessary if else. (#2985)
* Remove Unnecessary `if else`

* update samples
2019-05-25 00:10:11 +08:00
William Cheng
e284d2e466
Add a link to eBook (traditional chinese) (#2989) 2019-05-25 00:07:37 +08:00
Akihito Nakano
63e1e0451c
Add OPTiM to the company list (#2971) 2019-05-23 18:31:33 +09:00
Keiju Matsumoto
1e06d7fe88 [Kotlin] Fix parse error when using custom field names with @Json (#2944)
* Fix to use isEmpty method

* Add KotlinJsonAdapterFactory to moshi adapter

* Update petstore sample
2019-05-22 20:58:38 +09:00
Vincent Devos
6a1f33d2f8 adjust template folder to lang option (#2959)
* adjust template folder to lang option : scala-finch, java-msf4j, java-undertow, php-ze-ph

* Changing file permissions

* move ze-ph and finch resources folder
2019-05-22 20:55:05 +09:00