12694 Commits

Author SHA1 Message Date
Jim Schubert
a6d30cac9d
[core] Templating: limit compilation to supported extensions and constrain target paths (#6598) 2020-09-02 15:52:35 -04:00
Hippolyte HENRY
91ea6a17d9
[Java] Unalias type when generating default value for model property (#5017)
Co-authored-by: Jim Schubert <james.schubert@gmail.com>
2020-09-02 07:52:38 -04:00
William Cheng
966b87e66c
add aws v4 signature support to go-experimental (#7326) 2020-09-02 15:28:22 +08:00
William Cheng
d50d31cd5e
add structPrefix support to go-experimental (#7327) 2020-09-01 20:51:37 +08:00
Jim Schubert
26bb348354
Revert "Correct allOf with only one child schema (no discriminator)" (#7323)
This reverts commit 972120c35a31d20f51295e3ea66363d75304e9b7.
2020-08-31 22:46:57 -04:00
William Cheng
972120c35a
Correct allOf with only one child schema (no discriminator) (#6901) 2020-08-31 21:47:18 -04:00
Arvind Thirunarayanan
ab5b0fa8d4
[Go]: Interface definitions for api functions (#5914)
Introduces a new "generateInterfaces" option, allowing for better testability of generated clients
2020-08-31 21:43:40 -04:00
Oleh Kurpiak
14a500c6fe
[Java][Client] Use java8 OffsetDateTime for clients (#7190)
* use java8 OffsetDateTime for clients

* use java8 OffsetDateTime for clients

* fix javadoc

* add javadoc to JavaTimeFormatter.mustache

* add javadoc to JavaTimeFormatter.mustache

* add javadoc to JavaTimeFormatter.mustache
2020-08-31 22:31:28 +08:00
Patouche
b9662dc25d
[java] Intro openApiNullable property to enable/disable OpenAPI Jackson Nullable library (#6154)
* Add option to prevent usage of jackson-nullable (#2901)

Add a option for all java client and server to prevent
usage of third party library (jackson-databind-nullable)
which may be forbidden in some company

Add samples for Vertx, Spring MVC, Spring Cloud, Feign and Play

Upgrade dependencies for org.openapitools:jackson-databind-nullable

* Samples - Remove dependency org.openapitools:jackson-databind-nullable (#2901)

* Fix generation of gradle file for vertx (#2901)

* Regenerate samples (#2901)

* Fix documentation and up to date (#2901)

* Fix forgotten regeneration of vertx after dependency integration (#2901)

* Regenerate template after rebase (#2901)

* Use yaml config files introduce in #6509 to manage samples (#2901)

* Regenerate template using the config (#2901)

* Fix bad version during testing generated samples (#2901)

* Regenerate template after fix bad version (#2901)

* Fix merge, allow for set importing on codegen model

Co-authored-by: Jim Schubert <james.schubert@gmail.com>
2020-08-31 21:25:18 +08:00
William Cheng
7032c401ea
[Spring Boot] update dependencies, mark java8 option as deprecated (#7306)
* update springboot dependencies

* update doc

* update samples
2020-08-31 13:53:50 +08:00
Gmtstephane
15de43f7e4
Remove dot in golang type (#7307) 2020-08-31 13:50:20 +08:00
Jim Schubert
8eea149e14
[doc] Document usage of post-process file feature (#7315) 2020-08-31 13:44:44 +08:00
QP Hou
30074833cd
fix http bear auth documentation for go clinets (#7312) 2020-08-31 13:43:34 +08:00
Jiri Kuncar
d5a680e85f
[Extensions][Go][Java] Test x-auth-id-alias (#6642)
Co-authored-by: Jim Schubert <james.schubert@gmail.com>
2020-08-30 21:46:55 -04:00
Yuriy Belenko
da9f2f7c9b
[php-slim4] Move config to a separate file (#6971)
* Move config into separated file

* Restrict access from web to config folder

* Exclude config folder from code base

* Update documentation

* Refresh samples

* Fix misplaced pathes
2020-08-29 00:27:03 +08:00
Hui Yu
2c65605289
[C][Client][Clang Static Analyzer] Remove the useless free operation for (#7309)
buffContent
2020-08-29 00:17:55 +08:00
Richard Kolkovich
f681016ffd
Fix typescript-node generation when only models are generated (#7127)
* add model/index.ts

- move export of all models to model/index.ts
- move RequestFile definition to model/index.ts

This fixes #7126

* update samples

* Back out models/index.ts

Make this backwards-compatible:

- move `RequestFile` definition to `model/models.ts`
- remove `model/index.ts`
- re-export `RequestFile` from `api/apis.ts`
- make generation of `ObjectSerializer` conditional

* for some reason, Symfony isn't up to date

* reverts changes to php-symfony sample

* moves comment to mustache comment rather than TS comment

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>

* removes stale files from samples (no longer generated)

* updates samples

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
2020-08-28 17:19:53 +02:00
Hui Yu
08fe44c764
[C][Client][Clang Static Analyzer] Fix uninitialized argument value (#7305) 2020-08-28 09:44:55 +08:00
William Cheng
26c17c5774
[Java] remove deprecated jackson classes (#7304)
* [java/resttemplate] Generate valid code if no Authentication implementations present

Take the logic used to decide which instances to add to the authentications map and re-use to not import classes or offer non-functional util methods

* parameterize formParams

fixes #5782

* replace use of ISO8601DateFormat and ISO8601Utils with StdDateFormat

fixes #5779

* add constructor to intialise calendar

* Revert "[java/resttemplate] Generate valid code if no Authentication implementations present"

This reverts commit 6e450907bae1d831a4a8c9b66f6b707424f0a39a.

* Revert "parameterize formParams"

This reverts commit 7a26ce5dd21ce147ed33728cd0091a29175367a4.

* also override single arg parse method to avoid throwing exception

* also override single arg parse method to avoid throwing exception

* update samples

* update samples

* fix jersey1 tests

* fix jersey2 test

* update resteasy dependencies

* fix java jersey2 oas3 tests

* use java8 in springboot-beanvalidation

Co-authored-by: Jon Freedman <jon.freedman@zoho.com>
2020-08-27 23:13:56 +08:00
spacether
892836f772
Adds generator unaliasSchema method, uses it to refactor python-experimental (#7274)
* Adds generator specific unaliasSchema method

* Adds unaliasSchema and hasValidation methods in python-experimental generator

* Removes primitive models with no validations, docs, tests, and models

* Uses unaliasSchema in getSchemaType and adds todos

* Deletes handleMethodResponse and fromResponse

* Simplifies fromRequestBody

* Removes unneeded handleMethodResponse

* Updates javadoc

* Updates fromModel

* Adds python-exp java test defaultSettingInPrimitiveModelWithValidations, removes model NumberWithValidationsAndDefault form v3 sample spec

* Deletes getSimpleTypeDeclaration

* Removes straggler file

* Deletes hasValidation and modelWillBeMade

* Uses super in fromFormProperty

* Regenerates samples for python-experimental

* Updates postProcessAllModels
2020-08-27 08:07:33 -07:00
William Cheng
b4edfe477a
[Rust][reqwest] prefix local variables with "local_var" (#7299)
* use local_var prefix in rust variables

* minor fixes
2020-08-27 11:43:35 +08:00
William Cheng
8c1f6fcdc1
[Java][jersey2]Support enum discriminator value in child objects (#7267)
* support enum discriminator value in child (java jersey2)

* update samples

* add tests, use public
2020-08-27 11:42:48 +08:00
Hui Yu
f11b2e6772
[C][Client][Clang Static Analyzer] Fix memory leak before function returnning (#7302) 2020-08-27 09:38:22 +08:00
William Cheng
11a674f248
add extension for hashable in swift5 (#7300) 2020-08-26 19:29:29 +08:00
Bruno Coelho
98582d5780
[kotlin][client] fix warning Extension is shadowed by a member (#7286) 2020-08-26 11:21:40 +08:00
William Cheng
e6d3201623
[c-sharp] Fix default values with discriminator (#7296)
* [c-sharp] Fix #6225 default values with discriminator

* [c-sharp] Fix #6225 default values with discriminator

* update samples

Co-authored-by: Tom E <1036527+thommy101@users.noreply.github.com>
2020-08-26 09:36:11 +08:00
William Cheng
bc4994e82c
Add x-is-json to csharp generators (#7293)
* add x-is-json to csharp generators

* add docstring
2020-08-26 09:34:42 +08:00
Hui Yu
1852f61f3a
[C][Client][Clang Static Analyzer] Fix memory leak in apiClient_invoke (#7285) 2020-08-25 11:16:19 +08:00
Niels Pardon
d868fd6dc8
[Java][clients] remove java.lang prefix from Object (#6806) 2020-08-24 22:06:19 -04:00
Jim Schubert
a97feaf533
[core] Add x-is-free-form vendor extension (#6849)
This adds an x-is-free-form vendor extension to allow users to skip our
"free-form" logic which would previously prevent object schemas with no
properties to be considered "free-form". The previous behavior was due
in part to Swagger Parser not exposing `additionalProperties: false` to
us (which should be similar behavior to this extension).

A free-form object is considered a dynamic object with any number of
properties/types. DefaultGenerator does not allow for generation of
models considered free-form. However, a base type with no properties and
no additional properties is allowed by OpenAPI Specification and is
meaningful in many languages (e.g. "marker interfaces" or abstract
closed types).
2020-08-24 19:00:47 -04:00
Kim T
54a6c791f7
[NodeJS] Auto populate config using schema servers.url (#6980)
* [NodeJS] nodejs-express-server fix /api-docs path

* Auto populate config using schema servers.url

* [NodeJS] Auto populate config port 3000
2020-08-24 22:42:10 +08:00
Oleh Kurpiak
1dc65f0033
Remove warning when type importer manually (#7264) 2020-08-24 08:20:51 -04:00
Oleh Kurpiak
8bd2dd4c9d
[Java] [Spring] Spring new mapping annotations (#7189)
* Spring new mapping annotations

* update other spring mvc templates
2020-08-24 17:03:21 +08:00
4d-shibasawa
19140dc00d
typescript: added conditional for Subscriber importing (#7266) 2020-08-24 10:14:36 +02:00
taqm
3e734a0b54
[docs] Fix go-gin-server additional property docs. (#7188)
* [docs] Fix go-gin-server additional property docs.

* add cli option for serverPort, apiPath

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-08-24 14:19:23 +08:00
Mohamed EL HABIB
c893b92775
[BUG][MARKDOWN] Extra (back)slashes added to links from Api to Model #6095 (#6834)
Co-authored-by: Jim Schubert <james.schubert@gmail.com>
2020-08-24 00:13:17 -04:00
Alex-e
c1de6c2651
[scala][play] Update apiTrait.scala.mustache (#6891)
https://github.com/OpenAPITools/openapi-generator/issues/6889
2020-08-23 23:24:19 -04:00
Jim Schubert
f70d48ea73
[java] Appropriate instantiation of model with dynamic properties (#6052) 2020-08-23 17:41:49 -04:00
ParakhMittal
7bb8a8d9ff
Update apiInvoker.mustache and sample file for akka-scala client for issue #7258 fix (#7259)
* Update apiInvoker.mustache

In scala-akka-client code that is getting generated, addAuthentication method is called after setting headers using header parameter in the below mentioned line
addAuthentication(request.credentials)(
      httpRequest.withHeaders(headers(request.headerParams))
    )

However, in addAuthentication method, we are using withHeaders method that overwrites the headers set using header parameters. So, I am proposing to
change the addAuthentication method be replacing withHeaders() method to addHeader() to add authentication header to the list of already existing headers.

* Update ApiInvoker.scala

Added changes to sample for the client generator code change
2020-08-23 21:42:16 +08:00
sbu
fff5bfe8cb
[Dart] Get all enum values in a list (#7166)
* Provide getter `values` for all enum values

* Add values getter also to inline enum

* Generate samples

Co-authored-by: SimonIT <simonit.orig@gmail.com>
2020-08-23 21:37:52 +08:00
Jim Schubert
0e9c6dd9a8
[ci] Update gitattributes and allow skipping docs generation for Windows CI workflows (#7273) 2020-08-22 22:14:04 -04:00
Jim Schubert
da84d8e3bf
[core][bug] FILES is now path relative with no prefixes (#7271)
* FILES is now path relative with no prefixes

some Java implementations don't honor .relativize documentation fully.
When outDir is /a/b and the input is /a/b/c/d, the result should be c/d.
Some implementations make the output ./c/d which seems to mix the logic
as documented for symlinks. So we need to trim any / or ./ from the start,
as nobody should be generating into system root and our expectation is no ./

This resolves regeneration issues for those on such Java
implementations, although we've not been able to track down the exact
vendor or configurations which might lead to these differences.

* Ensure windows outputs FILES paths in same format

* Normalize FILES paths to remove relativization mid-path
2020-08-22 15:49:00 -04:00
TIm Clark
cbdedff0ad
[Java][jersey2] Add jersey injection dependencies (#7240)
* Adds the jersey injection dependency to gradle and sbt to match
the maven dependency.
* Update jersey version in sbt
2020-08-21 16:51:11 +08:00
Hui Yu
e8e6229d1b
[C][Clang Static Analyzer] Remove the useless variable when assembling URL (#7255) 2020-08-21 16:22:19 +08:00
sbu
f0fd2cbb22
Date format dart (#6389)
* Correct date format of date formatted strings

* Update petstore

* Regenerate samples on linux

* Remove final for letting the user configure custom date formats

Co-authored-by: SimonIT <simonit.orig@gmail.com>
2020-08-21 10:23:44 +08:00
William Cheng
06ab5b5c0f
minor enhancement to java client generator (#7253) 2020-08-21 00:35:26 +08:00
Frank Essenberger
d3017ffba8
typescript: Fix Union Types Import Issue (#6789)
* First approach for discussion

* typo

* add addiotional method

* polish a bit

* remove call of super method

* fix javadoc error

* com.google.common.collect.

* merge master regenerate samples

* sort imports alphabetically

* sort imports alphabetically with right key

* typo

* add type previous imports are still there.

* add type previous imports are still there.

* remove new test to see if they are the problem.

* merge master add tests back in

* align changes which should not lead to failing test but you never know.

* remove formatting changes

* dummy change

* revert spaces

* revert spaces

* revert functional changes

* comment out test

* remove model

* remove interface method

* remove test class completely

* put test class back - test body commented out

* rename test methods

* put back logic and tests

* remove generated APIs

* remark amakhrov

* check in one generated file to test

* adjust call super

* add comment use set.
2020-08-20 15:15:09 +02:00
Troy P
71321bd049
Modifying the es5 and es6 templates for javascript to handle default values (#6649)
for required fields better. This change ensures the required field isn't
overridden with undefined when the object is constructed - especially through
a chain of constructFromObject calls..
2020-08-20 15:24:11 +08:00
spacether
866df36c94
[python-exp] simplify examples (#7157)
* Adds example setting code in python-experimental with one fn setting example values

Fixes sample indentations

Handles composed schema models, object model and arraymodels

Adds brackets in arraymodel input

Sets modelName with map schemas

Removes included_schemas arguments, dicriminator examples do not include property examples

Refactors modelName into toExampleValueRecursive argument

Fixes bug where example models contained themselves

Stops using model ExampleGenerator examples because they are inconsistent with the ones in python-experimental

Uses example values if they exist

Removes single quotes from enum examples

Fixes password example

Adds commented our regex handling, commented out because it breaks

Handles AnyType schema examples

Adds x_example values for simple string properties, uses toExampleValue for all example generation

Adds examples for simple string parameters

Updates comments in toExampleValueBase

Fixes the double nested bug for AdditionalPropertiesWithArrayOfEnums

Fixes bug where NumberWithValidations had double nesting

Updates simple string examples in arrays

Fixes array string examples

Fixes example for string endpoint body example

Adds exampleFromStringOrArraySchema

Adds regex examples, pegs slf4j-version to v1.7.29 for rgxgen

Adds comment about regex seed

Updates pattern matcher to not handle ^ and $

Updates used sample values

Adds ensureQuotes

Adds ensureQuotes

Fixes double quote bug

Updates mustache file

Adds ensureQuotes to key handling

Adds modelNameToSchema map, reduces run time by using it

Fixes java tests

Regenerates python-experimental samples

Fixes python test

* Rebased on master

* Adds getModelNameToSchemaCache

* Updates toDefaultValue to not mutate schemas

* Has all dates and datetimes default and example setting use the same helper function

* Samples regenerated

* indentation tweak, removes txt from sample file
2020-08-19 21:27:31 -07:00
Aljaž Pavišič
c19350b179
Support for KumuluzEE microprofile runtime (#5944)
* Added library and edited generator to support server stub generation with Kumuluzee framework.

* Trimmed and tweaked pom.xml template and removed unnecessary template files from generator and library.

* minor edits

* Added new library to Java client codegen (microprofile-kumuluzee). A
functional KumuluzEE REST client can now be generated.

* Edited README for microprofile-kumuluzee

* Edited docs to include new KumuluzEE library options.

* Updated kee-rest-client client POM dependency version to latest

* fixed pom, edited REAMDE

* Trimmed redundant dependencies from KEE client pom

* Removed unnecessary DefaultGenerator edit, modified config template accordingly.

* Made mp framework an additional property for microprofile instead of being another library option, removed now redundant library files.

* Updated documentation with microprofile framework

* Fixed errors caused by removed functions and variables

* update doc

Co-authored-by: Chuckledog <aljaz.pavsic@gmail.com>
Co-authored-by: Jan Meznaric <jmezna@gmail.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-08-20 10:25:05 +08:00