Compare commits

...

210 Commits

Author SHA1 Message Date
William Cheng
2f235f0854 set skipFormModel to false by default 2023-09-12 16:11:51 +08:00
martin-mfg
d6695056fe add test case for nullable parent property (#16552)
* add nullable case to spring test spec

* generate samples for changed spring input

* add nullable case to general test spec

* generate samples for changed general input

* generate samples again

* generates samples again

* re-build from new sources, generates samples again
2023-09-12 15:59:58 +08:00
Philzen
196c2b1642 [maven-generator] Do not cleanup output if spec file is unchanged and skipIfSpecIsUnchanged=true (Fixes #16490) (#16491)
* Don't delete output directory if spec is unchanged

Resolves #16490

* Fix some typos
2023-09-12 15:42:19 +08:00
Dennis Melzer
c6d355e8d4 Fix spring scope property (#16553)
* Fix spring scope property

* Adapt test files
2023-09-12 14:58:26 +08:00
William Cheng
ad589c7700 better null check for schema types (#16564) 2023-09-12 14:58:05 +08:00
Julian Vennen
cd0fde41f1 fix parent class check in ObjectSerializer (#16558) 2023-09-12 10:25:28 +08:00
Julian Vennen
8b15d4820e Use backed enums in php-nextgen (#16556) 2023-09-11 20:06:50 +08:00
devhl-labs
1901bf23ea use TypeInfoResolver (#16548) 2023-09-11 20:05:02 +08:00
Justin Black
78f3b19b58 Removes spacether (#16551)
* Update README.md

* Update team.yml

* Update pom.xml
2023-09-11 12:49:10 +08:00
William Cheng
5ee18156db [Java-Feign]: model combining properties and additionalProperties (#16546)
* [Java-Feign]: model combining properties and additionalProperties (#6146)

* update samples

---------

Co-authored-by: François Dodé <francois.dode@dawex.com>
2023-09-09 16:11:54 +08:00
William Cheng
14cfca7b06 [java][feign] Update feign client dependencies to newer version (#16545)
* update javae feign client dependencies to new versions

* update feign
2023-09-09 15:39:02 +08:00
Julian Vennen
c354bf86ff Set minimal PHP Version to ^8.1 (#16542) 2023-09-09 14:46:49 +08:00
Andrew Tran
4e15e1a813 Update pom.xml (#16544) 2023-09-09 14:40:45 +08:00
William Cheng
18df6ed85f [Spring] fix nullable map properties (#16524)
* fix map in spring generators

* fix nullable map in spring generators
2023-09-09 13:30:21 +08:00
William Cheng
128d9da8a1 update smaples 2023-09-09 11:50:36 +08:00
Andreas Johnsen
75c2e934da add omitGradleWrapper option to kotlin-server code generator (#16528)
The added option removes the wrapper part of build.gradle, enabling the generated project to be used as a sub project. The same option from kotlin client was used as reference for this change.
2023-09-09 11:40:37 +08:00
William Cheng
c614b9d9b1 [Java][resteasy] Add tests to upload files (#16534)
* add test to upload files (resteasy)

* remove resteasy tests from github workflow
2023-09-08 15:57:10 +08:00
William Cheng
026fa514c3 update java resteasy samples 2023-09-08 15:12:54 +08:00
Alex Wood
6ea8ff3a17 [java-client][resteasy] fix multipart requests (#16517)
This patch fixes two issues with the Resteasy generated client code.
The first is the usage of a deprecated method, getFormData.  The fix for
this issue was originally conceived by @peter-seitz.

The second issue was a problem in how the Content-Disposition header was
being constructed.  If we had a file named "test.txt" and were uploading
it to a field named "myFile", the Content-Disposition header should look
like

Content-Disposition: form-data; name="myFile"

Instead, the code was using the file's name (rather than the field name)
in the name directive and the header looked like

Content-Disposition: form-data; name="test.txt"

The Content-Disposition header can take an optional directive, filename,
but I have not included that here as that directive is mostly useful for
file downloads and not uploads.
2023-09-08 15:07:49 +08:00
Tom Crasset
005566c6e3 [typescript] fix: allow 'additionalProperties: true' at top level (#16526)
* fix: allow 'additionalProperties: true' at top level

* refactor: use same call as other typescript generators
2023-09-08 08:46:15 +02:00
William Cheng
dee536f7f7 import Annotated if needed (#16521) 2023-09-07 14:36:45 +08:00
William Cheng
fbff32c5d7 update java resttemplate dep to newer versions (#16523) 2023-09-07 14:36:19 +08:00
William Cheng
d1808405ca mark oneOf form parameters as optional (#16512) 2023-09-06 17:27:44 +08:00
Diego Urban
3817e40f47 [JavaSpring] Generate deprecated property, annotation and javadoc. (#16493)
* [JavaSpring] Generate deprecated annotation and doc properties

* [JavaSpring] Generate deprecated for @Schema

* [JavaSpring] Add sample folder to workflow

---------

Co-authored-by: Diego Urban <d.urban@carepay.com>
2023-09-06 15:55:15 +08:00
Artur Neumann
270238e060 [PHP] convert data to string before giving it to preg_match (#16513) 2023-09-06 15:40:07 +08:00
martin-mfg
75ac4a2f58 Fix selection of unnecessary form parameter models (#16418)
* fix idea

* add unit test

* adjust warnings about form parameters
2023-09-06 15:23:04 +08:00
Robin Jonsson
acb798b58b [JavaSpring] Call parent fluent setters from child (#16497)
* Call fluent parent setter from child pojo

This closes #16496

* Generate new samples
2023-09-06 11:43:35 +08:00
William Cheng
b1ec110aa3 go: minor refactoring (#16508) 2023-09-06 11:02:09 +08:00
jessemyers-lettuce
b34a10aee7 python: ignore long lines for model descriptions (#16518)
Descriptions can easily exceed line-length limits because they are often
extracted from doc/comments strings, which may use unexpected formatting.

Python doc strings, in particular, are likely to use newlines, which mustache
does not preserve, causing descriptions to be condensed to a single line.
2023-09-06 10:48:43 +08:00
Mike Friesen
0192baed42 Issue: #16268 (#16507)
Bug fix AWS4Auth to support query parameters and updated to use AWS SDK V2 from V1
2023-09-06 09:45:02 +08:00
Toby Archer
ecb56f1e88 Fix Elixir connection.ex middleware usage and regenerate elixir sample (#16461) 2023-09-05 21:17:37 +02:00
jessemyers-lettuce
1b32088c2d python: use isinstance instead of type() (#16516)
Use of `isinstance` is preferred (and validated by common linters).
2023-09-05 23:45:18 +08:00
William Cheng
4b7a808a9f [openapi-normalizer] add a rule to better handle openapi 3.1 spec (#16495)
* add samples

* update samples

* openapi 3.1 beta support

* update .gitignore

* fix composed schema, add oneof, allof tests in opeanpi 3.1 spec

* add allof tests, more fixes

* add null check

* update artifact id

* better null check
2023-09-05 23:27:00 +08:00
Ivan Giuliani
065b48177b [Ruby] Fix incorrect escaping of Ruby forward slashes (#16474)
* [Ruby] Test correct escaping of pattern sequences

Ruby is not correctly escaping pattern sequences containing forward
slashes in their definition. This commit adds tests that verify the
correct behaviour of the code generator.

See issue #5582.

* [Ruby] Correctly escape patterns containing forward slashes

Ruby regexs are always generated as match patterns enclosed in slash
characters (i.e. using the `/pattern/` syntax). Regular expressions
defined in the OpenAPI declaration via the `pattern` attribute follow
[ECMA 262](https://262.ecma-international.org/5.1/#sec-15.10.1) which
means they already include the correct escaping of forward slashes as
far as Ruby is concerned.

The current Ruby codegen is incorrectly escaping all forward slashes,
which ultimately causes the generated code to include additional
incorrect escape sequences which cause the generated file to have an
invalid syntax.

This commit ports the same fix introduced in #1539 for the Python
codegen, as both Ruby and Python use perl-flavored regular expressions
so they behave in the same way when it comes to escaping forward
slashes.

Fixes #5582.
2023-09-05 20:12:29 +08:00
William Cheng
8608103c9f add name mapping features to lua client generator (#16511) 2023-09-05 20:03:27 +08:00
William Cheng
a9301a6c16 [perl] Add name mapping features to the Perl client generator (#16510)
* add name mapping features to perl client generator

* update samples
2023-09-05 18:39:38 +08:00
William Cheng
29f0d22713 [Powershell] add name mapping features (#16509)
* add name mapping features to the powershell generator

* update samples
2023-09-05 15:45:03 +08:00
devhl-labs
f3eb07408d [csharp] Support source generator (#16324)
* started source generator

* copy the options

* fixed visibility

* added new sample

* discarded changes to existing samples

* discarded changes to existing samples

* build new sample

* changed package name due to file path length limit

* reverted changes to manual tests

* fixed all new manual tests

* inject contexts into api

* only one JsonConstructor

* fixed spacing

* revert samples for easier merge master

* revert unnecessary change

* fixed formatting

* build samples

* reverting unintended commit

* fixing default value

* reverting unintended commit

* removed debugging lines

* removed unnecessary diff

* address comment
2023-09-05 10:18:08 +08:00
Théophane Charbonnier
4418b59b47 [java] Microprofile - fix optional array property's default value (#16500) 2023-09-05 10:15:10 +08:00
dependabot[bot]
616e8df8d0 Bump actions/checkout from 3 to 4 (#16505)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 09:50:08 +08:00
William Cheng
74cd73bd6c better null check in array default value (java) (#16503) 2023-09-05 00:40:17 +08:00
devhl-labs
c510ea4b3d Ensured enum entry name is unique (#16484)
* ensured enum entry name is unique

* ensured enum entry name is unique
2023-09-04 23:28:32 +08:00
Tomohiko Ozawa
09704951f0 [Java][resttemplate] Enable access token refresh (#16485)
* use supplier to enable refreshing token

* update samples

* fix param name and doc

* update samples
2023-09-04 23:23:22 +08:00
William Cheng
47a85e880b Add tests for http basic authentication in python client (#16488)
* add tests for http basic auth in python client

* add new files
2023-09-03 19:11:53 +08:00
devhl-labs
b59719a6ea [csharp][generichost] Minor formatting changes (#16482)
* started source generator

* copy the options

* fixed visibility

* added new sample

* discarded changes to existing samples

* discarded changes to existing samples

* build new sample

* changed package name due to file path length limit

* reverted changes to manual tests

* fixed all new manual tests

* inject contexts into api

* only one JsonConstructor

* fixed spacing

* revert samples for easier merge master

* revert unnecessary change

* fixed formatting

* build samples

* reverting unintended commit

* fixing default value

* reverting unintended commit

* move minor formatting changes to different pr
2023-09-03 16:20:12 +08:00
devhl-labs
dad677f63d [csharp][generichost] Remove unnecessary json options (#16483)
* started source generator

* copy the options

* fixed visibility

* added new sample

* discarded changes to existing samples

* discarded changes to existing samples

* build new sample

* changed package name due to file path length limit

* reverted changes to manual tests

* fixed all new manual tests

* inject contexts into api

* only one JsonConstructor

* fixed spacing

* revert samples for easier merge master

* revert unnecessary change

* fixed formatting

* build samples

* reverting unintended commit

* fixing default value

* reverting unintended commit

* removed unnecessary json option
2023-09-03 16:19:23 +08:00
William Cheng
6434c86afd [php-nextgen] add php-nextgen client generator (#16480)
* php-nextgen first commit

* [php] Set minimal PHP version to ^8.0 (#14500)

* Set minimal PHP version to ^8.0

* Fix php-nextgen config

* Change stability to BETA

* Add phplint package (#15054)

* [php-nextgen] Rename folders to follow PDS skeleton (#15102)

* Change lib -> src, test -> tests folder

This will make build compliant to PHP-PDS skeleton.
Ref: https://github.com/php-pds/skeleton

* Refresh samples

* Exclude composer.lock from codebase (#15105)

Since client generator is library and not a project it makes sense
to exclude composer.lock from codebase by default.

Ref: http://getcomposer.org/doc/02-libraries.md#lock-file

* Add @generated tag to DocBlocks (#15106)

This tag in draft status right now(PSR-19), but I think we can leverage
from it already.

Ref: https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#55-generated

* update samples, doc

* update samples

---------

Co-authored-by: Yuriy Belenko <yura-bely@mail.ru>
2023-09-03 16:16:58 +08:00
William Cheng
ebc9bcda44 [java][native] Add tests for oneOf form parameters (#16487)
* add tests for oneOf form parameters

* update samples
2023-09-03 16:15:54 +08:00
William Cheng
69c3f567ce [Swift] various improvements (#16481) 2023-09-02 20:13:01 +01:00
William Cheng
8c2de11ac2 [rust] fix nullable array (#16473)
* add tests for nullable array in rust

* fix nullable array in rust

* minor fix
2023-09-02 10:21:04 +08:00
William Cheng
a2177570b3 update python samples 2023-09-02 01:07:33 +08:00
jessemyers-lettuce
40731ed52d python: several typing and style improvements (#16378)
* python: several typing and style improvements

The generated (python) code fails with several standard validation tools,
including `flake8`, `mypy`, and `autoflake`. While fixing every possible
violation -- especially wrto typing -- woudl be a project, some of the
changes are fairly easy.

 - The `autoflake` tool picks up on unused imports. These can just be removed.

 - The `mypy` tool picks up on numerious typing violations, especially if set
   to its strictest mode. As a starting point, all functions ought to annotate
   a return type, including constructors, even if the return type is `None`
   because otherwise the functions are omitted from type checking and it's
   impossible to make incremental progress towards adding types.

 - The `flake8` tool mostly finds whitespace and line-length issues; while
   line-length standards very, the source already includes several flake8
   ignores, so it seems safe to add a few more.

* Add generated files

* Restore imports used by `AbstractPythonCodegen.java`

* Update generated files
2023-09-02 01:03:02 +08:00
devhl-labs
c0abeceb85 [csharp] Fixed enum values with whitespace (#16316)
* fixed enum values

* build samples

* build samples

* revert samples for easier merge master

* fixed while not changing other generators

* changed logging

* minor change
2023-09-01 10:11:11 +08:00
William Cheng
c74ed98282 Fix indent lambda using \n as line break (#16464)
* fix indent lambda using \n as line break

* update tests

* more fix
2023-09-01 09:07:14 +08:00
Cliford
71b33db7ee Fix global property separator (#16465) 2023-08-31 21:02:19 +08:00
William Cheng
07a5920b2f fix slash in python aiohttp files (#16463) 2023-08-31 15:59:18 +08:00
William Cheng
72da3b2c76 fix slash in php gneerator doc/config (#16462) 2023-08-31 15:22:38 +08:00
William Cheng
5954daea18 [powershell] update doc to use backslash (#16460)
* add backslash, forwardslash lambda

* update api doc
2023-08-31 14:29:01 +08:00
Davy Durham
4a1c70f2f1 fix: python client generator didn't respect range response specification (#16451)
* bug: python client generator didn't respect range response specification (e.g. "1XX", "2XX", etx.).  Return values tended to become None as a result

* update samples

---------

Co-authored-by: William Cheng <wing328hk@gmail.com>
2023-08-31 10:15:30 +08:00
William Cheng
e73143d777 fix cast exception with uuid default (c) (#16449) 2023-08-31 10:03:20 +08:00
William Cheng
a0350c6533 Fix cast exception when handling example/default of UUID/Long type (#16450)
* fix cast exception when handling uuid example/default

* more cast exception fix

* better fix in example generator

* better code format

* better code format
2023-08-31 09:42:38 +08:00
William Cheng
bceae5695e Fix model name being a type in TS abstract codegen (#16392)
* fix model name being a type in ts abstract codegen

* add a test

* better code format
2023-08-30 13:24:54 +02:00
Jim Simon
9cc5513a1c Fix Issue 16385 (#16387) 2023-08-30 14:23:53 +08:00
martin-mfg
20692aa891 Properly handle mappings and import mappings after processOpts (#16216)
* make Java imports overridable

* fix for other dateLibraries

* complete core fix

* adapt test - step 1/2

* add unit test

* adapt test - step 2/2

* remove accidentally added file

* final small clean-up
2023-08-30 13:48:51 +08:00
EdithBirrer1
35f5852cc0 Fix null request body issue (#16376)
* suggestion how to fix #9217

* removed check for versions V2/v3

* removed useless import
2023-08-30 13:40:35 +08:00
William Caine
134dc98a71 fix: Using Map.Entry to avoid "reference to Entry is ambiguous" (#16445)
* fix: Using Map.Entry to avoid "reference to Entry is ambiguous"

when spec defines a model Entry it conflicts.  Also rest of mustache
uses  Map.Entry to matching it

* fix: Map.Entry - update samples
2023-08-30 12:57:53 +08:00
William Cheng
8386a6eaaf [java] improve petstore tests with openapi v3 spec (#16447)
* regenerate tests in jersey2-java8 client

* update samples

* fix java google api client tests

* update java resteasy to use v3 spec for tests

* update java vertx to test with v3 spec

* update java resttemplate to test with v3 spec

* add new files

* regenerate jersey1 tests
2023-08-30 12:33:01 +08:00
William Cheng
611a60411b fix cast exception in uuid default value (julia) (#16438) 2023-08-29 20:42:49 +08:00
William Cheng
b1564d8002 Fix UUID default value cast exception (swift5) (#16436) 2023-08-29 12:32:01 +01:00
ChengDaqi2023
b14f99df92 update golang.org/x/net v0.2.0 to 0.7.0 (#16148) 2023-08-29 18:51:32 +08:00
William Cheng
5ab1badbef fix cast exception in default value of uuid (objc) (#16437) 2023-08-29 18:43:53 +08:00
William Cheng
9b6e6b3e49 Fix cast exception in uuid default value (haskell-http-client) (#16439)
* fix cast exception in uuid default value (haskell-http-client)

* better code format
2023-08-29 18:42:27 +08:00
William Cheng
b5867ebf2b fix cast exception in array default value (java gen) (#16434) 2023-08-29 14:31:24 +08:00
martin-mfg
020415facc add test to invoke each generator and catch simple crashes (#16425)
* add test

* remove unused imports

* remove SmartBear copyright line

* use 3.0 input
2023-08-29 13:35:45 +08:00
William Cheng
b457c3de70 fix uuid example cast exception in python generators (#16432) 2023-08-29 13:34:54 +08:00
William Cheng
1a654eba5c better handling of null pointer in CodegenSecurity (#16433) 2023-08-29 13:33:35 +08:00
Yohei Kitamura
56105fbbe6 [ruby] Not symbolize header param keys to allow the usage of underscore ("_") character (#16396)
* [ruby] Not symbolize header param keys to allow the usage of underscore ("_") character

* use lambda to convert header key to a string if underscore is included
2023-08-29 10:42:53 +08:00
William Cheng
55252f4b25 update ruby samples 2023-08-28 15:17:05 +08:00
jumpei.yokota
21cbd1ab71 [Ruby] align indentation (#16423) 2023-08-28 15:08:50 +08:00
Wojciech Trocki
6310ecdb0f issue15126: restore default support for golang generator (#15127) 2023-08-28 11:38:09 +08:00
Stephane Carrez
0dcd8b42b0 Fix 16417: [Ada] Server generation fails for some response types (#16421)
* Fix and improvement of Ada server code generator

- add support for EWS (Embedded Web Server)
- fix GNAT project to avoid depending on util_http but instead use util_aws or util_curl
- update server skeleton generation to handle more data types for the response
- add more explanation on the generated server README

* Rebuild the Ada client GNAT project
2023-08-28 10:18:50 +08:00
Robert Oschwald
ec835fbd94 Update kotlin-client okHttp3 api.mustache fixes 16410 (#16411)
- populate body into the ServerException message
2023-08-25 19:06:43 +01:00
Yoonho Go
0f8f18e727 Update api.service.mustache (#16406)
Fix miscast types. At compile time, it says it can't find toISOString because the parameter is of type string, because modifies the whole thing.
2023-08-25 10:41:22 +02:00
William Cheng
80121aa88f Prepare v7.0.1 (#16409)
* prepare 7.0.1 in master

* update doc
2023-08-25 16:11:29 +08:00
y-tomida
c7100b9e61 wrap operand listOf (#16408) 2023-08-25 08:37:48 +01:00
William Cheng
c37fa8a4e8 prepare v7.0.0 release (#16407) 2023-08-25 15:05:29 +08:00
martin-mfg
ad7ce7cba6 fix scalatra on Windows (#16395) 2023-08-25 09:25:22 +08:00
Baptiste Le Morlec
26899ee59b Adding model type hints for Python Flask (#16382)
Co-authored-by: Baptiste LE MORLEC <baptiste.lemorlec@stryker.com>
2023-08-24 20:49:28 +08:00
Felipe Crochik
9cda7b0965 use propertyBaseName instead of propertyName (#15668)
Since it is looking at the payload before the transformation it should use the "original name" and not the "generated name" for the property
2023-08-24 11:54:52 +02:00
Dan Leehr
35f6eec71d Add supportedMediaTypes needed for kubernetes client (#16386)
* Add supportedMediaTypes needed for kubernetes client

https://github.com/kubernetes-client/javascript/issues/893

* Add generated files
2023-08-24 08:43:50 +02:00
William Cheng
91fc151451 Add mapping features to Julia generators (#16370)
* add mapping features to julia generators

* additional changes required for mapped names (#16383)

---------

Co-authored-by: Tanmay Mohapatra <tanmaykm@gmail.com>
2023-08-24 10:09:54 +08:00
devhl-labs
7e67e3aafb Lambda refactors (#16369)
* started source generator

* copy the options

* fixed visibility

* added new sample

* discarded changes to existing samples

* discarded changes to existing samples

* build new sample

* changed package name due to file path length limit

* reverted changes to manual tests

* fixed all new manual tests

* inject contexts into api

* only one JsonConstructor

* fixed spacing

* reverted samples changes

* reverted more unrelated changes

* reverted more unrelated changes

* minor refactors
2023-08-24 09:56:56 +08:00
dependabot[bot]
da411b3f3f Bump s4u/setup-maven-action from 1.8.0 to 1.9.0 (#16388)
Bumps [s4u/setup-maven-action](https://github.com/s4u/setup-maven-action) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/s4u/setup-maven-action/releases)
- [Commits](https://github.com/s4u/setup-maven-action/compare/v1.8.0...v1.9.0)

---
updated-dependencies:
- dependency-name: s4u/setup-maven-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-24 09:54:37 +08:00
Robert Schuh
6146129bdc [typescript] add http info calls to access headers (#16260)
* [typescript] add http info calls to access headers

* [typescript] add http info calls to access headers

* [typescript] add http info calls to access headers

* [typescript] add http info calls to access headers

* [typescript] add http info calls to access headers

---------

Co-authored-by: Robert Schuh <robert.schuh@valtech.com>
2023-08-23 11:25:27 +02:00
Lezenford
3e95001939 [Kotlin-Spring] fix arrays response api after generation (#16296)
* issues/16295 fix arrays response api after generation

* fix samples

* fix samples

---------

Co-authored-by: Lezenford <alex.v.plekhanov@gmail.com>
2023-08-23 10:52:15 +08:00
Anis
00de163655 [python-flask] adopt python3.5+ syntax (#16375)
* adopt python3.5+ syntax

removing some residual python2 code, since it is not supported anymore, like:
- no need for `six` anymore
- no need for encoding utf8 in top file
- remove `object` inheritance in base model
- remove absolute import `__future__`

* generate samples

applying the new templates

* update python ignore pattern

ignore all the `.venv` folders
2023-08-23 10:42:40 +08:00
Kevin B
646ec8ba41 Fixing spelling of circiut => circuit (#16381) 2023-08-23 10:41:05 +08:00
Martin Kresse
bb507d5e6c allow check for path parameters in matrix style (#16331)
* isMatrix added

* tests for isMatrix flag added
2023-08-22 20:36:16 +08:00
William Cheng
85d7b38084 Add mapping features to Abstract C++ Codegen (#16373)
* add mapping feature to cpp abstract codegen

* better code format
2023-08-22 17:50:41 +08:00
William Cheng
9c9c45a73e add mapping features to c client generator (#16371) 2023-08-22 14:58:41 +08:00
lance-yuan-igt
32fe92fee9 [BUG] C# Aspnetcore Adding Name property for header parameters (#16360)
* Adding Name property for header param

* update samples

* update samples

* update doc

---------

Co-authored-by: William Cheng <wing328hk@gmail.com>
2023-08-22 09:39:18 +08:00
clement-brodu
1a458d3e0b fix: memory leak with restclient (#13961) (#16365) 2023-08-21 20:26:37 +08:00
William Cheng
656d2c2263 remove flash codegen (#16372) 2023-08-21 17:20:45 +08:00
William Cheng
d9423a4edb [PHP] 6.0.x make php implementation depend on meta packages for http client (#16368)
* add psr-18 support

* update doc

* fix test
2023-08-21 10:45:51 +08:00
Filip Šmíd
2815e6a538 [BUG][kotlin-client][multiplatform] Write data to packet (#16367)
* fix: write data to packet

* docs: update samples
2023-08-21 10:31:49 +08:00
Chris
7f7717498f [BUG] [java][jersey2/3] clientBuilder gets overwritten after call to customizeClientBuilder (#16355)
* [java][jersey2/3] call customizeClientBuilder after default config init

* regenerate the samples
2023-08-20 22:50:05 +08:00
devhl-labs
a600ef0ded only one JsonConstructor (#16361) 2023-08-20 22:49:40 +08:00
William Cheng
e1b1b7d0c7 [csharp] JsonConverter.mustache - fix propertyName variable conflict (#16356)
* JsonConverter.mustache - Obfuscate "propertyName" variable to rare name "__jsonPropertyName__" to avoid conflict with generated variables

obfuscate "propertyName" variable, fixes issue if #allVars contains a variable named "propertyName" conflicting with the declared variable

* prefix local variable with localVar

* remove eol

* minor fix

* update

---------

Co-authored-by: SDP190 <sprizant1@gmail.com>
2023-08-19 23:33:05 +08:00
William Cheng
4140b387fb update go samples 2023-08-19 23:32:44 +08:00
Wouter Wijsman
a55453b5f7 Update go-gin-server templates to return a configurable library (#10479)
* Update go-gin-server templates to return a configurable library

Before this change, the user would be required to make changes in the
generated code. This makes it really hard to update the API and the
documentation at the same time. With this change, the generated code can
be imported as is and used. The user just needs to set the handler
functions for each endpoint.

* Use spaces instead of tabs for api files

* Use space instead of tab for ApiHandleFunctions in go-gin-server

* Update samples for go-gin-server
2023-08-19 18:42:58 +08:00
YusukeOba
141b3d4e0b [kotlin-client][multiplatform] HttpClient can now be passed as an argument to ApiClient (#16343)
* [kotli-client][multiplatform] Added to inject HttpClient into the argument of ApiClient

* [kotlin-client][multiplatform] update generated samples
2023-08-19 17:05:11 +08:00
William Cheng
ff19825610 [java] Remove hardcoded arrays in template (#16340)
* remove hardcoded arrays in template

* better model import in java client

* update

* better code format

* minor refactoring

* update
2023-08-19 10:20:48 +08:00
William Cheng
b006b1b128 Improve documentations (#16346)
* improve doc

* update urls
2023-08-19 10:20:02 +08:00
Simon Wegendt
778a53a406 [Kotlin Client] Implement octet-stream/binary (#16341)
* Implement octet-stream/binary for Kotlin client code generator

* Fix OkHttp3 generator flavor
2023-08-17 10:40:22 +01:00
William Cheng
e69c58623f update samples 2023-08-17 12:03:43 +08:00
Perdjesk
a9a4aa4bf8 Array default value requires import of java.util.Arrays (#16246) 2023-08-17 11:49:49 +08:00
YusukeOba
c3c0188bf4 [kotlin-multiplatform] Fixed build error when setting formdata in array (#16329) 2023-08-15 21:07:10 +08:00
YusukeOba
2e17653ae8 [kotlin-client][multiplatform] Added support enum query parameter (#16327)
* [kotlin-multiplatform] add enum parameter support

* [kotlin-multiplatform] update generated samples
2023-08-15 17:10:26 +08:00
William Cheng
4f6a25f4b5 [JAVA] [WebClient] Handle list of String special case in WebClient generator (#16326)
* [Java][WebClient] support string list return type

* [Java][WebClient] add test

* [Java][WebClient] support string list return type

* [Java][WebClient] support string list return type

* fix webclient auto-generated test files

---------

Co-authored-by: Gavin.Wu <gavin.guohao.wu@kingland.com>
2023-08-15 13:53:04 +08:00
devhl-labs
76bb8a40d8 [csharp] Fixed model property data type (#16315)
* fixed model property data type

* build samples
2023-08-15 09:57:00 +08:00
Yonatan Karp-Rudin
35fec8da0e Update the SumUp logo to the new logo (#16323)
This commit only updates the sumup logo to the latest logo

Co-authored-by: Yonatan Karp-Rudin <yonatan.karp@sumup.com>
2023-08-15 09:56:23 +08:00
Yonatan Karp-Rudin
c3c7a547b7 Add SumUp to the list of clients (#16322)
This commit adding SumUp into the list of companies that are using OpenAPI Generator.

Co-authored-by: Yonatan Karp-Rudin <yonatan.karp@sumup.com>
2023-08-14 19:57:48 +08:00
William Cheng
bcd934d15a fix missing comma in kotlin api client (#16320) 2023-08-14 14:54:06 +08:00
William Cheng
f1bacd23e7 remove python flask py2 samples (#16319) 2023-08-14 13:34:25 +08:00
Yassine Ilmi
931197a1cd Clean-up - Unnecessary trailing underscores in Python Flask, AIOHttp, BluePlanet (#16249)
* Remove trailing underscore in security_controller_.py and base_model_.py

* Regenerating sample files

* Clean-up files with trailing underscore in samples

* Update security extension to use the new security_controller

* Regenerate unmaintained samples
2023-08-14 13:26:24 +08:00
devhl-labs
47020f10b7 fixed class definition (#16318) 2023-08-14 13:23:44 +08:00
devhl-labs
ef9520f989 [csharp] Fixed operation nested return type (#16314)
* fixed operation nested return type

* more robust fix
2023-08-14 13:07:36 +08:00
Yonatan Karp-Rudin
83af019603 Fix Retrofit template with Jackson for Kotlin (#14239)
* Fix Retrofit template with Jackson (Fix #8147)

This commit amends the `ApiClient` template for Retrofit. It fixes a bug where the Retrofit client uses Jackson as the serialization library.

Until now, the `ApiClient` could not be compiled when using the Jackson library (default in SpringBoot applications), as the constructor of the class had the following parameter:

`private val serializerBuilder: Builder = Serializer.Builder,`

The change done in the commit, is to ensure that in case of Jackson, the right property of the `Serializer` class is assigned

* Add sample code for `kotlin-jvm-jackson`

This commit adds a sample code for the `kotlin-jvm-jackson` generated code to test the changes on CI

* Update kotlin code samples for CI

This commit only runs the command `bin/generate-samples.sh bin/configs/kotlin-*` to ensure that all code samples are up-to-date and CI can pass successfully.
2023-08-14 10:06:49 +08:00
Sanjay Marreddi
2ef888845d Update CMake to fix cpprest linking for UNIX (#14199) 2023-08-12 17:32:49 +08:00
Vincent Giersch
604239abba feat(swift5): allow to swift build in linux (#15060)
* feat(swift5): allow to swift build in linux

* chore(ci): add .github/workflows/samples-swift.yaml

* feat(swif5): bump Alamofire to 5.7.0

* chore(ci): run in macos all swift sample clients
2023-08-12 16:24:01 +08:00
Théophane Charbonnier
057bc8e626 [Java][Client] Microprofile Jackson serialization (#15940) 2023-08-12 12:15:59 +08:00
devhl-labs
1878c45be5 moved regex processing (#16309) 2023-08-12 11:29:19 +08:00
devhl-labs
f4dfd99566 removed nonexistant account (#16310) 2023-08-12 11:28:59 +08:00
Emanuele Saccomandi
8f9e6432f5 fixed zapier removeKeyPrefixes method (#16305) 2023-08-11 19:09:54 +08:00
William Cheng
2635b52b42 [go] fix issue that tempfile is not deleted (#16303)
* #15131 Issue: Tempfile is not deleted

* delete tempfile in go client

---------

Co-authored-by: Aniruddh <aniruddhjoshi94@gmail.com>
2023-08-11 14:40:56 +08:00
William Cheng
8885701648 minor enhancements to ts rxjs generator (#16302) 2023-08-11 11:10:33 +08:00
William Cheng
9d100d8f6b Fix removing dollar sign for name sanitization (#16301)
* fix replacing dollar sign

* try to add tests
add list import
add missing imports
import OpenAPI
fix import ?
fix import?
rename methods
test test fix
test python test fix
fix??
fix??

---------

Co-authored-by: Joshix-1 <57299889+Joshix-1@users.noreply.github.com>
Co-authored-by: Joshix-1 <joshix.dev@mailbox.org>
2023-08-11 10:40:47 +08:00
rainmanhhh
a33c353a26 [typescript-rxjs] Update servers.mustache (#9449)
* Update servers.mustache

add hasOwnProperty checking; use const instead of var

* use 4 spaces instead of tabs
2023-08-11 10:30:40 +08:00
Harish Karumuthil
cc496ff2eb Feature suppoert dart sample code in html2 generator (#7908)
* Add dart example

* Run `./bin/generate-samples.sh ./bin/configs/other/html2.yaml`
2023-08-11 10:18:41 +08:00
William Cheng
590430c774 Issue#15129 Feature Request Description (#16299)
Co-authored-by: Aniruddh <aniruddhjoshi94@gmail.com>
2023-08-11 09:42:47 +08:00
William Cheng
3ad3cf7dd9 add tests for array of number in java okhttp client (#16298) 2023-08-10 23:37:12 +08:00
n1t4chi
e8160d8d7d Improve type reference in toEntity call in order to fix issue with LinkedHashMap being returned instead of maped object to POJO (#16293) 2023-08-10 23:22:08 +08:00
William Cheng
fd12bb3508 [python] Fix data type (#16291)
* fix data type in python client codegen

* add model mapping feature
2023-08-10 23:05:35 +08:00
Marc Miltenberger
7a7309edb8 Fix Java GSON client not accepting optional null arrays (#16213)
* Add check for null JSON array in GSON Java api client

* Update samples
2023-08-10 22:58:23 +08:00
William Cheng
36cb3ce6b9 add tests, workflow for haskell samples (#16290) 2023-08-10 10:42:57 +08:00
Masahiro Sakai
9f051ec640 [haskell-servant][haskell-yesod] fix specialCharReplacements (#16289)
HaskellServantCodegen and HaskellYesodServerCodegen modify
specialCharReplacements by replacing its keys: backslash ("\\") with
"\\\\" and "\"" with "\\\"".

It seems that those replacements were for using the keys in string
literals in the specialChars table in the generated code. However,
modifying the keys causes the substitution of those characters in
field names not to work, making generated code syntactically invalid.

Since the specialChars table has already been removed, we can safely
stop modifying the specialCharReplacements.
2023-08-10 09:43:02 +08:00
Rodrigo de Almeida - RMA3
d955ff6988 Add annotations to the operation - case permission validation - Fix 12219 15822 (#16259)
* fix #12219 #15822

* add test with array

* update samples

---------

Co-authored-by: Rodrigo Maciel de Almeida <rodrigo.almeida@wefin.com.br>
2023-08-09 17:21:57 +03:00
William Cheng
84d619b883 fix travis build (#16288) 2023-08-09 16:28:59 +08:00
André Roaldseth
75b04bb965 Ensure enum classes toString() returns kotlin.String (#16247)
When creating an enum where a valid value is `String`, the override of toString() will be the wrong type.

Simply using `*kotlin*.String` will allow using `String` as a value in an enum.
2023-08-09 15:09:21 +08:00
William Cheng
6a8039c672 update doc 2023-08-09 14:38:56 +08:00
Jonathan Wenger
d9001b8a6f Add additional reserved words for java and csharp (#16276)
Co-authored-by: Jonathan Wenger <jonathan.wenger@avalara.com>
2023-08-09 14:30:22 +08:00
ふぁ
a3d14c87c4 [Dart/CSharp/Python] replace File.separator with slash (#16282)
Signed-off-by: ふぁ <yuki@yuki0311.com>
2023-08-09 14:28:31 +08:00
William Cheng
3f8bce6695 update samples 2023-08-09 14:27:57 +08:00
martin-mfg
3ed59cd593 [spring] reactive: fix Content-Type (#16228)
* don't set content-type to client's value

* revert manual sample change

* better fix

* generate samples

* cover 3rd case

* add new test endpoint
2023-08-08 15:52:18 +03:00
William Cheng
3d064c6115 [Python] refactor pydantic model methods into abstract python codegen (#16279)
* refactor methods from python client to abstract python codegen

* refactor regular expression methods

* more refactoring

* more refactoring
2023-08-08 20:42:43 +08:00
ふぁ
f3b930c48c [python-nextgen] Fix noqa: E501 position (#16280)
* Fix `noqa: E501` position

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

---------

Signed-off-by: ふぁ <yuki@yuki0311.com>
2023-08-08 20:42:12 +08:00
KaiNative
7703560e73 Updating Maven-Plugin Dependencies (#16274)
* bugfix-15672 updated mavenplugin dependencies

* bugfix-15672 re-added maven-compat since needed by maven-plugin-testing-harness

* bugfix-15672 explicit dependency of plexus archiver in a new version due to CVEs in version included from maven-plugin-testing-harness (2.2)

---------

Co-authored-by: Kai Neuhaus <kneuhaus@communicode.de>
2023-08-08 15:06:50 +08:00
William Cheng
c377a11c57 update samples 2023-08-08 14:57:53 +08:00
devhl-labs
de8f846666 [csharp] Improved regex support (#16269)
* improved regex support

* better parsing of options

* better handling of options

* spacing change

* typo

* rename the x-modifier- extension

* trivial change

* added to the sample
2023-08-08 11:40:20 +08:00
William Cheng
362b596fce update kotlin client dependencies (#16273) 2023-08-08 10:06:08 +08:00
William Cheng
29c5d6109a mark java-okhttp3 option as deprecated in kotlin client (#16272) 2023-08-08 10:05:52 +08:00
William Cheng
a9cfa1f391 [kotlin-spring] minor bug fixes (#16270)
* kotlin-spring: minor bug fixes

* comment out tests
2023-08-08 10:05:34 +08:00
William Cheng
50ee574d1f [kotlin] Escape dollar sign in baseName (#16266)
* escape dollar sign in baseName (kotlin)

* escape dollar sign in kotlin server jaxrs-spec template

* add new files

* update samples
2023-08-08 10:05:15 +08:00
Ween Jiann
2b44d4ed93 [go-server] Partially reverts and fix #15185 (#16258)
* Partitally reverts #15185

* Remove unused import

* Set zero value if param is empty

* Refactor samples, add test config

* Add tests

* Clean up

* Fix test
2023-08-07 20:43:30 +08:00
William Cheng
4e5bd8a30a add martin-mfg to java, spring (#16271) 2023-08-07 15:02:55 +08:00
martin-mfg
6a3f0ffb37 [spring] fix void return type for useResponseEntity: false (#16230)
* fix return type

* add new sample config as test for the fix

* update samples
2023-08-07 14:53:05 +08:00
William Cheng
097385bde6 [bug][kotlin] sanitize model names according to convention (#16267)
* [bug][kotlin] sanitize model names according to convention

* [bug][kotlin] revert to english word sanitization except minus

---------

Co-authored-by: Theo Meneau <tmeneau@clearcover.com>
2023-08-07 14:38:29 +08:00
Martin Visser
f6ac603e15 [kotlin] Add fix for wrongly encoded backticks for reserved words when generating kotlin-spring server code (#14027) 2023-08-07 09:32:00 +08:00
William Cheng
9322c2fc29 fix default value, add nullable support (#16265) 2023-08-06 20:08:22 +08:00
Patrick Del Conte
350ec2a763 [kotlin-server][jaxrs-spec] treat parameters with a default value as non-null (#14413) 2023-08-06 15:55:27 +08:00
Sebastian Ziegler
17194f3ff0 Fix enum headers values while using Kotlin jvm-okhttp (#16133) 2023-08-06 15:37:33 +08:00
William Cheng
5b2ceac93d fix anyOf in handling primitive types in java client (#16264) 2023-08-06 13:48:13 +08:00
Noor Dawod
1d4a6d713f Dart deep-equals (#16251)
* Add support for deep equality for complex types.

* Use version of collection used by the SDK.

* Use a const instead of final.

* Use deep equality only for arrays and maps.

* Generate pet store sources.

* Downgrade version of dependency.

* Expose `DeepCollectionEquality` instance.

* Revert last change.
2023-08-06 13:12:45 +08:00
William Cheng
f0b100a9ad Add a test for BigDecimal parameter in java client (#16263)
* add a test for BigDecimal parameter in java client

* update tests
2023-08-06 12:14:21 +08:00
karzang
e299382a42 [Java][Client] Fix handling of 'number' types in oneOf (#16202) 2023-08-06 11:16:50 +08:00
William Cheng
d9e32a79a5 Support library option via additionalProperties (#16242)
* set library option obtain from additionalProperties

* test library

* update samples

* remove old files
2023-08-05 13:41:04 +08:00
William Cheng
6f05655101 Add mapping features to R client generator (#16252)
* add mapping features to r client generator

* update samples
2023-08-05 13:34:57 +08:00
William Cheng
d1f23ef663 add mapping features to crystal client generator (#16253) 2023-08-05 13:34:34 +08:00
William Cheng
f6fb83878b [Default] update isAdditionalPropertiesTrue tag to cover more types (#16227)
* enhance additional properties support

* update samples

* update tests

* add more tests

* update samples

* fix samples
2023-08-05 13:32:43 +08:00
Ken Kaizu
c080660cc1 [Scala] scala-akka-http-server support pekko-http using useApachePekko flag (#16255)
* introduce useApachePekko flag into scala-akka-http-server

* useApachePekko flag in scala-akka-http-server templates

* introduce scala-pekko-http-server samples
2023-08-05 13:32:02 +08:00
William Cheng
82516c75d2 Fix implements in oneof, anyof templates in java okhttp client generator (#16241)
* fix implements in oneof, anyof templates in java okhttp

* add tests

* update samples
2023-08-03 21:09:00 +08:00
hai22yu23
cb56e50e0c support 32bit in postdata (#16238) 2023-08-03 18:13:42 +08:00
Masahiro Sakai
45d8027bb4 [haskell-servant][haskell-yesod] Use table-based conversion for field name conversion (#16232)
* [haskell-servant][haskell-yesod] use table-based conversion for field name conversion

Current fieldLabelModifier implementation always produces uncapitalize
name, but it is inappropriate if the original JSON field name begins
with a capital letter.

* [haskell-servant][haskell-yesod] regenerate samples
2023-08-03 13:29:33 +08:00
William Cheng
81c398e530 add model name mappings support to the elixir client generator (#16233) 2023-08-02 17:26:52 +08:00
William Cheng
1d39902930 Add name mappings support to JS client (#16234)
* add name mappings support to JS client

* update doc

* udpate doc

* update doc
2023-08-02 17:26:23 +08:00
William Cheng
d67f5ddeff Fix circleci node 4 failure (#16236)
* fix circleci failure

* remove debug

* fix
2023-08-02 15:13:13 +08:00
martin-mfg
0ce1fef016 fix 2 sonar-reported bugs (#16229) 2023-08-02 14:27:27 +08:00
William Cheng
4602f18ca8 Add model name mapping feature to C# codegen (#16209)
* add model name mapping feature to C# codegen

* rename file

* update samples

* update doc
2023-08-02 10:06:11 +08:00
William Cheng
3278eea9a4 Add tests for #16217 (#16221)
* add tests for #16217

* add new files
2023-07-31 11:03:36 +08:00
ふぁ
77311c3d76 [python-nextgen] Fix allOf missing imports (#16217)
* [python-nextgen] fix allOf missing imports

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] remove circular import

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] Fix circular refs

Signed-off-by: ふぁ <yuki@yuki0311.com>

---------

Signed-off-by: ふぁ <yuki@yuki0311.com>
2023-07-31 10:04:53 +08:00
Antti Leppä
c6a100cce2 Added support for using mutiny instead of coroutines for asynchronous kotlin server APIs (#15262) 2023-07-31 09:50:44 +08:00
William Cheng
bf181906e0 [Swift] property, parameter name mapping support (#16207)
* add property, parameter naming support to swift5 generator

* revert change

* remove files

* update samples
2023-07-30 22:44:19 +08:00
William Cheng
f3b3de2a29 add property, parameter name mapping to php generators (#16206) 2023-07-30 21:58:05 +08:00
William Cheng
243b5569ef [Rust] add property, parameter name mapping (#16205)
* add name, parameter mapping to rust generators

* add, fix test

* undo cahnge
2023-07-30 21:57:35 +08:00
William Cheng
526ca78e79 add tests for #16199 (python client) (#16220) 2023-07-30 01:19:11 +08:00
ふぁ
48ff57b4f6 [python-nextgen] fix #16010 circular refs lead to no imports (#16199)
* [python-nextgen] fix #16010 circular refs lead to no imports

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] remove unnecessary Postponed annotations

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] remove unnecessary Postponed annotations

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

---------

Signed-off-by: ふぁ <yuki@yuki0311.com>
2023-07-30 00:42:46 +08:00
William Cheng
d41fe12c1f [python] Add tests for simple object with additional properties (#16218)
* add tests for simple object without additional properties

* update logic
2023-07-29 11:43:37 +08:00
ふぁ
d9fc039dcf [python-nextgen] fix #16151 Disallow additional properties if not present - missing Any and Dict import (#16208)
* [python-nextgen] fix #16151 Disallow additional properties if not present - missing Any and Dict import

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] remove unwanted imports

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] remove unwanted imports

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

---------

Signed-off-by: ふぁ <yuki@yuki0311.com>
2023-07-29 10:51:28 +08:00
ふぁ
e411b2ac0a [python-nextgen] Add type to actual instance (#16204)
* [python-nextgen] add type to actual_instance

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] fixed unnecessary type conversions

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

---------

Signed-off-by: ふぁ <yuki@yuki0311.com>
2023-07-29 10:08:06 +08:00
Marc Miltenberger
adac3b127f Support for multipart/form-data; charset="utf-8" in Java GSON Generator (#16211)
* Support for multipart/form-data; charset="utf-8"

Previously, it was only checked for an exact equal string, which failed when there were additional options such as charset.

* Update samples
2023-07-29 00:22:19 +08:00
William Cheng
7ca84e5c88 Add name, parameter name mapping to abstract go codegen (#16171)
* add name, parameter name mapping to abstract go codegen

* better code format
2023-07-28 09:57:23 +08:00
William Cheng
5d2e80977b add name, parameter mapping to scala generators (#16194) 2023-07-28 09:51:50 +08:00
William Cheng
954d41b9aa [C#] Add property, parameter naming support (#16196)
* add property, parameter naming support to c# generators

* update

* fix workflow

* update test

* update
2023-07-28 09:51:33 +08:00
William Cheng
184dfd2edd [Kotlin] Add name, parameter mapping support (#16193)
* add name, parameter mapping support to abstract kotlin

* remove files
2023-07-28 09:42:08 +08:00
William Cheng
86cf4f1eb1 add mapping option to ada codegen (#16190) 2023-07-28 09:41:43 +08:00
Masahiro Sakai
f6a819686d [haskell][haskell-yesod] Fix special char replacements (#16197)
* [haskell][haskell-yesod] remove fixOperatorChars()

fixOperatorChars() does not change input strings since special
characters have already been replaced in DefaultCodegen.fromModel().

* [haskell][haskell-yesod] do not prefix with quote ("'") when generating removeFieldLabelPrefix table

We switched from the conversion done by fixOperatorChars() to the
conversion done by DefaultCodegen.fromModel() and the latter does not
insert quote characters. So We modify the removeFieldLabelPrefix table
to conform the new mapping.

* [haskell][haskell-yesod] remove forParsing parameter from removeFieldLabelPrefix function

Aeson's fieldLabelModifier always convert Haskell field names to JSON
field names, whether at parse time or not. (Note that stripPrefix and
uncapitalize do not take such parameter)

* [haskell][haskell-yesod] perform replaceSpecialChars after stripping prefix

Because replaceSpecialChars can corrupt prefix if the prefix contains
a replacement string of a specfial character as a substring.

* [haskell][haskell-yesod] regenerate samples
2023-07-28 09:35:46 +08:00
William Cheng
d7311cd5cd [Ruby] add property, parameter name mapping (#16191)
* add property, parameter name mapping support to ruby generators

* update samples
2023-07-27 09:48:53 +08:00
Adam Shannon
90eacb685c fix(golang): make sure xml.Encoder is closed (#16141) 2023-07-26 15:48:46 +08:00
William Cheng
30c38ed7ad fix potential npe in ada codegen (#16188) 2023-07-26 14:12:45 +08:00
William Cheng
596487aa6c update doc, customization.md (#16189) 2023-07-26 14:11:36 +08:00
7226 changed files with 358393 additions and 26593 deletions

View File

@@ -204,8 +204,8 @@ jobs:
- command_build_and_test:
nodeNo: "3"
node4:
docker:
- image: fkrull/multi-python
machine:
image: ubuntu-2004:202201-02
working_directory: ~/OpenAPITools/openapi-generator
shell: /bin/bash --login
environment:
@@ -215,7 +215,7 @@ jobs:
DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli
steps:
- checkout
- command_docker_build_and_test:
- command_build_and_test:
nodeNo: "4"
workflows:
version: 2

View File

@@ -800,12 +800,6 @@
"Client: Python"
]
},
{
"input": "python-server-flask-petstore-python2.sh",
"matches": [
"Server: Python"
]
},
{
"input": "python-server-flask-petstore.sh",
"matches": [

View File

@@ -21,5 +21,5 @@
./bin/utils/ensure-up-to-date
```
Commit all changed files.
- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (6.3.0) (minor release - breaking changes with fallbacks), `7.0.x` (breaking changes without fallbacks)
- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (7.0.1 - patch release), `7.1.x` (minor release - breaking changes with fallbacks), `8.0.x` (breaking changes without fallbacks)
- [ ] If your PR is targeting a particular programming language, @mention the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) members, so they are more likely to review the pull request.

View File

@@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Test run-in-docker.sh
shell: bash

View File

@@ -13,7 +13,7 @@ jobs:
name: Gradle plugin tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:

View File

@@ -30,7 +30,7 @@ jobs:
- samples/client/petstore/java/okhttp-gson-group-parameter
- samples/client/petstore/java/webclient-swagger2
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

View File

@@ -20,7 +20,7 @@ jobs:
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
@@ -45,7 +45,7 @@ jobs:
${{ runner.os }}-gradle-
- name: Setup Maven
uses: s4u/setup-maven-action@v1.8.0
uses: s4u/setup-maven-action@v1.9.0
with:
java-version: ${{ matrix.java }}
maven-version: 3.8.8
@@ -85,9 +85,9 @@ jobs:
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Maven
uses: s4u/setup-maven-action@v1.8.0
uses: s4u/setup-maven-action@v1.9.0
with:
java-version: 11
maven-version: 3.8.8

View File

@@ -13,7 +13,7 @@ jobs:
name: Maven plugin tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:

View File

@@ -15,7 +15,7 @@ jobs:
name: Misc tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'

View File

@@ -15,7 +15,7 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
@@ -53,7 +53,7 @@ jobs:
needs:
- build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
@@ -90,7 +90,7 @@ jobs:
needs:
- build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
@@ -129,7 +129,7 @@ jobs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:

View File

@@ -13,7 +13,7 @@ jobs:
name: Build c libcurl client
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Prepare
run: |
sudo apt-get update

View File

@@ -28,7 +28,7 @@ jobs:
tools: 'tools_openssl_x64'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt-version }}

View File

@@ -17,7 +17,7 @@ jobs:
name: Tests Dart
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

View File

@@ -18,7 +18,7 @@ jobs:
# clients
- samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: 3.1.*

View File

@@ -42,7 +42,7 @@ jobs:
- samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse
- samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: '7.0.x'

View File

@@ -18,7 +18,7 @@ jobs:
# clients
- samples/client/echo_api/csharp-restsharp/
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: '6.0.x'

View File

@@ -20,6 +20,8 @@ on:
- samples/client/petstore/csharp/OpenAPIClient-net5.0/**
# build C# API client (.net 5.0 with ConditionalSerialization)
- samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/**
# build C# API client (property, parameter name mappings)
- samples/client/petstore/csharp-restsharp-name-parameter-mappings/**
pull_request:
paths:
# build C# API client (multiple frameworks)
@@ -39,6 +41,8 @@ on:
- samples/client/petstore/csharp/OpenAPIClient-net5.0/**
# build C# API client (.net 5.0 with ConditionalSerialization)
- samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/**
# build C# API client (property, parameter name mappings)
- samples/client/petstore/csharp-restsharp-name-parameter-mappings/**
jobs:
build:
name: Build .Net clients
@@ -65,8 +69,10 @@ jobs:
- samples/client/petstore/csharp/OpenAPIClient-net5.0/
# build C# API client (.net 5.0 with ConditionalSerialization)
- samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/
# build C# API client (property, parameter name mappings)
- samples/client/petstore/csharp-restsharp-name-parameter-mappings
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: '6.0.x'

View File

@@ -29,7 +29,7 @@ jobs:
- samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse
- samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: '6.0.x'

View File

@@ -21,7 +21,7 @@ jobs:
- samples/client/petstore/elm
- samples/openapi3/client/elm
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: jorelali/setup-elm@v5
with:
elm-version: 0.19.1

View File

@@ -26,7 +26,7 @@ jobs:
- samples/client/petstore/erlang-client/
- samples/client/petstore/erlang-proper/
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: '22.2'

View File

@@ -24,7 +24,7 @@ jobs:
- samples/server/petstore/go-api-server/
- samples/server/petstore/go-chi-server/
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "stable"

View File

@@ -21,7 +21,7 @@ jobs:
sample:
- samples/client/petstore/groovy
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

36
.github/workflows/samples-haskell.yaml vendored Normal file
View File

@@ -0,0 +1,36 @@
name: Samples Haskell
on:
push:
paths:
- samples/server/petstore/haskell-yesod/**
- samples/server/petstore/haskell-servant/**
- samples/client/petstore/haskell-http-client/**
pull_request:
paths:
- samples/server/petstore/haskell-yesod/**
- samples/server/petstore/haskell-servant/**
- samples/client/petstore/haskell-http-client/**
jobs:
build:
name: Build stack projects
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
# servers
- samples/server/petstore/haskell-yesod/
- samples/server/petstore/haskell-servant/
- samples/client/petstore/haskell-http-client/
steps:
- uses: actions/checkout@v4
- uses: haskell/actions/setup@v2
with:
# ghc-version: '8.8.4' # Exact version of ghc to use
# cabal-version: 'latest'. Omitted, but defaults to 'latest'
enable-stack: true
stack-version: 'latest'
- name: stack test
working-directory: ${{ matrix.sample }}
run: stack test

View File

@@ -20,7 +20,7 @@ jobs:
- samples/client/echo_api/java/native
- samples/client/echo_api/java/feign-gson
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

View File

@@ -24,7 +24,7 @@ jobs:
- samples/client/echo_api/java/feign-gson
- samples/client/echo_api/java/okhttp-gson
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

View File

@@ -43,12 +43,13 @@ jobs:
- samples/client/petstore/java/webclient-swagger2
- samples/client/petstore/java/vertx
- samples/client/petstore/java/jersey2-java8-localdatetime
- samples/client/petstore/java/resteasy
- samples/client/petstore/java/google-api-client
- samples/client/petstore/java/rest-assured
- samples/client/petstore/java/rest-assured-jackson
- samples/client/petstore/java/microprofile-rest-client
- samples/client/petstore/java/microprofile-rest-client-3.0
- samples/client/petstore/java/microprofile-rest-client-3.0-jackson
- samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml
- samples/client/petstore/java/apache-httpclient
- samples/client/petstore/java/feign
- samples/client/petstore/java/jersey1
@@ -61,7 +62,7 @@ jobs:
- samples/client/petstore/java/resttemplate-swagger2/
- samples/openapi3/client/petstore/java/jersey2-java8-swagger2/
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

View File

@@ -21,7 +21,7 @@ jobs:
- samples/client/petstore/java/resttemplate-jakarta
- samples/client/petstore/java/webclient-jakarta
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

View File

@@ -23,7 +23,7 @@ jobs:
- samples/server/petstore/java-helidon-server/se
version: [17]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

View File

@@ -29,7 +29,7 @@ jobs:
- samples/server/petstore/java-play-framework-no-swagger-ui
- samples/server/petstore/java-play-framework-no-wrap-calls
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

View File

@@ -31,7 +31,7 @@ jobs:
- samples/server/petstore/java-pkmst/
- samples/server/petstore/java-undertow/
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

View File

@@ -40,7 +40,7 @@ jobs:
- samples/server/petstore/jaxrs-cxf-non-spring-app
- samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

View File

@@ -45,7 +45,7 @@ jobs:
- samples/client/petstore/spring-http-interface-reactive
- samples/client/petstore/spring-http-interface
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

View File

@@ -15,7 +15,7 @@ jobs:
name: Tests Julia
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: 1.8

View File

@@ -4,9 +4,11 @@ on:
push:
branches:
- 'samples/client/petstore/kotlin*/**'
- 'samples/client/others/kotlin-jvm-okhttp-parameter-tests/**'
pull_request:
paths:
- 'samples/client/petstore/kotlin*/**'
- 'samples/client/others/kotlin-jvm-okhttp-parameter-tests/**'
env:
GRADLE_VERSION: 6.9
@@ -49,6 +51,7 @@ jobs:
- samples/client/petstore/kotlin-array-simple-string-multiplatform
- samples/client/petstore/kotlin-bigdecimal-default-multiplatform
- samples/client/petstore/kotlin-bigdecimal-default-okhttp4
- samples/client/petstore/kotlin-jvm-jackson
- samples/client/petstore/kotlin-jvm-ktor-jackson
- samples/client/petstore/kotlin-jvm-ktor-gson
- samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization
@@ -59,8 +62,10 @@ jobs:
- samples/client/petstore/kotlin-jvm-spring-2-webclient
- samples/client/petstore/kotlin-jvm-spring-3-webclient
- samples/client/petstore/kotlin-spring-cloud
- samples/client/petstore/kotlin-name-parameter-mappings
- samples/client/others/kotlin-jvm-okhttp-parameter-tests
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

View File

@@ -4,9 +4,13 @@ on:
push:
branches:
- 'samples/server/petstore/kotlin-springboot-3*/**'
# comment out due to gradle build failure
# - samples/server/petstore/kotlin-spring-default/**
pull_request:
paths:
- 'samples/server/petstore/kotlin-springboot-3*/**'
# comment out due to gradle build failure
# - samples/server/petstore/kotlin-spring-default/**
env:
GRADLE_VERSION: 7.4
@@ -21,8 +25,10 @@ jobs:
sample:
# server
- samples/server/petstore/kotlin-springboot-3
# comment out due to gradle build failure
# - samples/server/petstore/kotlin-spring-default/
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

View File

@@ -3,10 +3,16 @@ name: Samples Kotlin server
on:
push:
branches:
- samples/server/others/kotlin-server/jaxrs-spec/**
- 'samples/server/petstore/kotlin*/**'
# comment out due to gradle build failure
#- samples/server/petstore/kotlin-spring-default/**
pull_request:
paths:
- samples/server/others/kotlin-server/jaxrs-spec/**
- 'samples/server/petstore/kotlin*/**'
# comment out due to gradle build failure
# - samples/server/petstore/kotlin-spring-default/**
env:
GRADLE_VERSION: 6.9
@@ -29,11 +35,15 @@ jobs:
- samples/server/petstore/kotlin-springboot-springfox
- samples/server/petstore/kotlin-server/ktor
- samples/server/petstore/kotlin-server/jaxrs-spec
- samples/server/petstore/kotlin-server/jaxrs-spec-mutiny
- samples/server/petstore/kotlin-server-modelMutable
- samples/server/others/kotlin-server/jaxrs-spec
# comment out due to gradle build failure
#- samples/server/petstore/kotlin-spring-default
# no build.gradle file
#- samples/server/petstore/kotlin-vertx-modelMutable
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

View File

@@ -18,7 +18,7 @@ jobs:
# servers
- samples/server/petstore/php-laravel/lib/
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:

View File

@@ -18,7 +18,7 @@ jobs:
# servers
- samples/server/petstore/php-symfony/SymfonyBundle-php/
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:

View File

@@ -18,7 +18,7 @@ jobs:
# clients
- samples/client/echo_api/python
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.7'

View File

@@ -18,7 +18,7 @@ jobs:
# servers
- samples/server/petstore/python-aiohttp/
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.7'

View File

@@ -25,7 +25,7 @@ jobs:
- samples/client/petstore/rust/
- samples/server/petstore/rust-server/
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable

View File

@@ -27,10 +27,11 @@ jobs:
- samples/server/petstore/scala-lagom-server
- samples/server/petstore/scala-play-server
- samples/server/petstore/scala-akka-http-server
- samples/server/petstore/scala-pekko-http-server
- samples/server/petstore/scalatra
- samples/server/petstore/scala-finch # cannot be tested with jdk11
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

View File

@@ -18,7 +18,7 @@ jobs:
# clients
- samples/openapi3/client/petstore/spring-cloud-3-with-optional
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

View File

@@ -3,10 +3,16 @@ name: Samples Java Spring
on:
push:
paths:
# clients
- 'samples/client/petstore/spring*/**'
# servers
- 'samples/server/petstore/spring*/**'
- 'samples/openapi3/server/petstore/spring*/**'
pull_request:
paths:
# clients
- 'samples/client/petstore/spring*/**'
# servers
- 'samples/server/petstore/spring*/**'
- 'samples/openapi3/server/petstore/spring*/**'
jobs:
@@ -27,12 +33,14 @@ jobs:
- samples/openapi3/client/petstore/spring-cloud-async
- samples/openapi3/client/petstore/spring-cloud-spring-pageable
- samples/client/petstore/spring-cloud-tags
- samples/client/petstore/spring-cloud-deprecated
# servers
- samples/server/petstore/springboot
- samples/openapi3/server/petstore/springboot
- samples/server/petstore/springboot-beanvalidation
- samples/server/petstore/springboot-useoptional
- samples/server/petstore/springboot-reactive
- samples/server/petstore/springboot-reactive-noResponseEntity
- samples/server/petstore/springboot-implicitHeaders
- samples/openapi3/server/petstore/springboot-implicitHeaders
- samples/server/petstore/springboot-delegate
@@ -48,7 +56,7 @@ jobs:
- samples/server/petstore/springboot-spring-pageable-without-j8
- samples/server/petstore/springboot-spring-pageable
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'

50
.github/workflows/samples-swift.yaml vendored Normal file
View File

@@ -0,0 +1,50 @@
name: Samples Swift
on:
push:
paths:
- samples/client/petstore/swift5/**
pull_request:
paths:
- samples/client/petstore/swift5/**
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [macos-latest]
sample:
- samples/client/petstore/swift5/alamofireLibrary
- samples/client/petstore/swift5/anycodableLibrary
- samples/client/petstore/swift5/asyncAwaitLibrary
- samples/client/petstore/swift5/combineLibrary
- samples/client/petstore/swift5/default
- samples/client/petstore/swift5/deprecated
- samples/client/petstore/swift5/frozenEnums
- samples/client/petstore/swift5/nonPublicApi
- samples/client/petstore/swift5/objcCompatible
- samples/client/petstore/swift5/oneOf
- samples/client/petstore/swift5/promisekitLibrary
- samples/client/petstore/swift5/readonlyProperties
- samples/client/petstore/swift5/resultLibrary
- samples/client/petstore/swift5/rxswiftLibrary
- samples/client/petstore/swift5/urlsessionLibrary
- samples/client/petstore/swift5/validation
# NOTE: disabled as vaporLibrary doesnt build when adding this CI config
#- samples/client/petstore/swift5/vaporLibrary
- samples/client/petstore/swift5/x-swift-hashable
include:
- os: ubuntu-latest
sample: samples/client/petstore/swift5/alamofireLibrary
name: Build Swift samples
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: swift-actions/setup-swift@v1
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
swift-version: '5'
- name: Build
working-directory: ${{ matrix.sample }}
run: swift build

View File

@@ -18,7 +18,7 @@ jobs:
sample:
- samples/client/petstore/zapier
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
- name: Install dependencies

View File

@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'OpenAPITools' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:

View File

@@ -18,7 +18,7 @@ jobs:
matrix:
java: [11, 17]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
@@ -39,7 +39,7 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
- name: Setup Maven
uses: s4u/setup-maven-action@v1.8.0
uses: s4u/setup-maven-action@v1.9.0
with:
java-version: ${{ matrix.java }}
maven-version: 3.8.8

7
.gitignore vendored
View File

@@ -89,6 +89,7 @@ samples/client/petstore/cpp-restsdk/cmake_install.cmake
**/.gradle
samples/client/petstore/java/hello.txt
samples/client/petstore/java/okhttp-gson/hello.txt
samples/client/petstore/java/okhttp-gson-3.1/hello.txt
samples/client/petstore/java/jersey1/hello.txt
samples/client/petstore/java/jersey2-java8/hello.txt
samples/client/petstore/java/jersey2/hello.txt
@@ -173,17 +174,17 @@ samples/client/petstore/csharp-refactor/OpenAPIClient/nuget.exe
# Python
*.pyc
__pycache__
.venv/
samples/client/petstore/python/dev-requirements.txt.log
samples/client/petstore/python/swagger_client.egg-info/SOURCES.txt
samples/client/petstore/python/.coverage
samples/client/petstore/python/.projectile
samples/client/petstore/python/.venv/
samples/client/petstore/python-asyncio/.venv/
samples/client/petstore/python-asyncio/.pytest_cache/
samples/client/petstore/python-tornado/.venv/
# PHP
samples/client/petstore/php/OpenAPIClient-php/composer.lock
samples/client/petstore/php-nextgen/OpenAPIClient-php/composer.lock
samples/client/petstore/php-dt/composer.lock
samples/client/petstore/php-dt-modern/composer.lock
samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/composer.lock

View File

@@ -136,7 +136,7 @@ script:
# run integration tests defined in maven pom.xml
# WARN: Travis will timeout after 10 minutes of no stdout/stderr activity, which is problematic with mvn --quiet.
# show "error" only to reduce the log size
- ./mvnw -e --no-snapshot-updates --quiet --batch-mode --show-version clean install -DskipTests -Dmaven.javadoc.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error 2>&1 | grep -i error
- ./mvnw -e --no-snapshot-updates --quiet --batch-mode --show-version clean install -DskipTests -Dmaven.javadoc.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error
after_success:
# push to maven repo
- if [ $SONATYPE_USERNAME ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then

View File

@@ -9,15 +9,6 @@ set -e
export NODE_ENV=test
function cleanup {
# Show logs of 'petstore.swagger' container to troubleshoot Unit Test failures, if any.
if [ "$NODE_INDEX" != "4" ]; then
docker logs petstore.swagger # container name specified in circle.yml
fi
}
trap cleanup EXIT
if [ "$NODE_INDEX" = "1" ]; then
echo "Running node $NODE_INDEX to test 'samples.circleci' defined in pom.xml ..."
java -version

View File

@@ -15,7 +15,7 @@
<div align="center">
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.0.0`):
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.0.1`):
[![Build Status](https://api.travis-ci.com/OpenAPITools/openapi-generator.svg?branch=master&status=passed)](https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds)
[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator)
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator)
@@ -115,13 +115,16 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
| OpenAPI Generator Version | Release Date | Notes |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
| 7.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.0.0-SNAPSHOT/) | May/Jun 2023 | Major release with breaking changes (no fallback) |
| [6.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.6.0) (latest stable release) | 11.05.2023 | Minor release with breaking changes (with fallback) |
| 7.0.1 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.0.1-SNAPSHOT/) | 08.09.2023 | Patch release (enhancements, bug fixes, etc) |
| [7.0.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.0.0) (latest stable release) | 25.08.2023 | Major release with breaking changes (no fallback) |
| [6.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.6.0) | 11.05.2023 | Minor release with breaking changes (with fallback) |
| [5.4.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.4.0) | 31.01.2022 | Minor release with breaking changes (with fallback) |
| [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) |
OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0
(We do not publish daily/nightly build. Please use SNAPSHOT instead)
For old releases, please refer to the [**Release**](https://github.com/OpenAPITools/openapi-generator/releases) page.
For decomissioned generators/libraries/frameworks, please refer to [the "Decommission" label](https://github.com/OpenAPITools/openapi-generator/issues?q=label%3ADecommission+is%3Amerged+) in the pull request page.
@@ -176,16 +179,16 @@ See the different versions of the [openapi-generator-cli](https://search.maven.o
<!-- RELEASE_VERSION -->
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.6.0/openapi-generator-cli-6.6.0.jar`
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.0/openapi-generator-cli-7.0.0.jar`
For **Mac/Linux** users:
```sh
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.6.0/openapi-generator-cli-6.6.0.jar -O openapi-generator-cli.jar
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.0/openapi-generator-cli-7.0.0.jar -O openapi-generator-cli.jar
```
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
```
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.6.0/openapi-generator-cli-6.6.0.jar
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.0/openapi-generator-cli-7.0.0.jar
```
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
@@ -420,7 +423,7 @@ openapi-generator-cli version
To use a specific version of "openapi-generator-cli"
```sh
openapi-generator-cli version-manager set 6.6.0
openapi-generator-cli version-manager set 7.0.0
```
Or install it as dev-dependency:
@@ -444,7 +447,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\temp\php_api_client`)
<!-- RELEASE_VERSION -->
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.6.0/openapi-generator-cli-6.6.0.jar)
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.0/openapi-generator-cli-7.0.0.jar)
<!-- /RELEASE_VERSION -->
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
@@ -906,6 +909,8 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- 2023-04-27 - [Create an Angular Client using OpenAPI Specifications](Create an Angular Client using OpenAPI Specifications) by [Patric](https://pguso.medium.com/)
- 2023-05-16 - [Adyen for Java developers](https://www.adyen.com/blog/adyen-java-library) by [Beppe Catanese, Developer Advocate, Adyen](https://github.com/gcatanese)
- 2023-05-18 - [如何基于 Swagger 使用 OpenAPI Generator 生成 JMeter 脚本?](https://blog.51cto.com/u_15181572/6294974) by [高楼Zee)](https://blog.51cto.com/u_15181572)
- 2023-06-28 - [Generate API contract using OpenAPI Generator Maven plugin](https://huongdanjava.com/generate-api-contract-using-openapi-generator-maven-plugin.html) by [Khanh Nguyen](https://huongdanjava.com/)
- 2023-06-30 - [Generate Client SDKs with OpenApi Generator in Springboot](https://medium.com/@ramavathvinayak/generate-client-sdks-with-openapi-generator-in-springboot-f9f012e73c0b) by [Vinayak Ramavath](https://medium.com/@ramavathvinayak)
## [6 - About Us](#table-of-contents)
@@ -1135,7 +1140,7 @@ If you want to join the committee, please kindly apply by sending an email to te
| Bash | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09) |
| C | @zhemant (2018/11) @ityuhui (2019/12) @michelealbano (2020/03) |
| C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) |
| C# | @mandrean (2017/08) @frankyjuang (2019/09) @shibayan (2020/02) @Blackclaws (2021/03) @lucamazzanti (2021/05) @iBicha (2023/07) |
| C# | @mandrean (2017/08) @shibayan (2020/02) @Blackclaws (2021/03) @lucamazzanti (2021/05) @iBicha (2023/07) |
| Clojure | |
| Crystal | @cyangle (2021/01) |
| Dart | @jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12) @ahmednfwela (2021/08) |
@@ -1148,8 +1153,8 @@ If you want to join the committee, please kindly apply by sending an email to te
| GraphQL | @renepardon (2018/12) |
| Groovy | |
| Haskell | |
| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) |
| Java Spring | @cachescrubber (2022/02) @welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02) @Zomzog (2022/09) |
| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @martin-mfg (2023/08) |
| Java Spring | @cachescrubber (2022/02) @welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02) @Zomzog (2022/09) @martin-mfg (2023/08) |
| JMeter | @kannkyo (2021/01) |
| Jetbrains HTTP Client | @jlengrand (2023/01) |
| Julia | @tanmaykm (2023/01) |
@@ -1163,7 +1168,7 @@ If you want to join the committee, please kindly apply by sending an email to te
| Perl | @wing328 (2017/07) [:heart:](https://www.patreon.com/wing328) @yue9944882 (2019/06) |
| PHP | @jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), [@ybelenko](https://github.com/ybelenko) (2018/07), @renepardon (2018/12) |
| PowerShell | @wing328 (2020/05) |
| Python | @spacether (2019/11) [:heart:][spacether sponsorship] @krjakbrjak (2023/02) |
| Python | @krjakbrjak (2023/02) |
| R | @Ramanth (2019/07) @saigiridhar21 (2019/07) |
| Ruby | @cliffano (2017/07) @zlx (2017/09) @autopp (2019/02) |
| Rust | @frol (2017/07) @farcaller (2017/08) @richardwhiuk (2019/07) @paladinzh (2020/05) @jacob-pro (2022/10) |

15
bin/configs/ada.yaml Normal file
View File

@@ -0,0 +1,15 @@
generatorName: ada
outputDir: samples/client/petstore/ada
inputSpec: modules/openapi-generator/src/test/resources/3_0/ada/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/Ada
nameMappings:
_type: P_UnderscoreType
type_: P_TypeWithUnderscore
http_debug_operation: P_HTTPDebugOperation
parameterNameMappings:
_type: UnderscoreType
type_: TypeWithUnderscore
http_debug_operation: HttpDebugOperation
additionalProperties:
modelPackage: Samples.Petstore
projectName: Petstore

View File

@@ -2,3 +2,6 @@ generatorName: c
outputDir: samples/client/petstore/c
inputSpec: modules/openapi-generator/src/test/resources/2_0/c/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/C-libcurl
modelNameMappings:
another_model: MappedModel
another_property: mappedProperty

View File

@@ -7,3 +7,12 @@ additionalProperties:
moduleName: Petstore
shardName: petstore
strictSpecBehavior: false
modelNameMappings:
PropertyNameMapping: AnotherPropertyNameMapping
nameMappings:
_type: underscore_type
type_: type_with_underscore
type-: type_with_dash
parameterNameMappings:
_type: underscore_type
type_: type_with_underscore

View File

@@ -0,0 +1,12 @@
# for csharp generichost
generatorName: csharp
outputDir: samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
library: generichost
templateDir: modules/openapi-generator/src/main/resources/csharp
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
useSourceGeneration: true
packageName: UseSourceGeneration

View File

@@ -0,0 +1,18 @@
generatorName: csharp
outputDir: samples/client/petstore/csharp-restsharp-name-parameter-mappings
inputSpec: modules/openapi-generator/src/test/resources/3_0/name-parameter-mappings.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
nameMappings:
_type: UnderscoreType
type_: TypeWithUnderscore
http_debug_operation: HttpDebugOperation
parameterNameMappings:
_type: UnderscoreType
type_: TypeWithUnderscore
http_debug_operation: HttpDebugOperation
modelNameMappings:
Environment: Env
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
hideGenerationTimestamp: "true"
targetFramework: net6.0

View File

@@ -4,3 +4,10 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-e
templateDir: modules/openapi-generator/src/main/resources/elixir
additionalProperties:
invokerPackage: OpenapiPetstore
modelNameMappings:
DeprecatedObject: DeprecatedModel
# the following options have no effect on elixir client gen which uses baseName
nameMappings:
deprecatedRef: deprecatedReference
parameterNameMapping:
ioutils: ioutils_parameter

View File

@@ -2,8 +2,17 @@ generatorName: go
outputDir: samples/openapi3/client/petstore/go/go-petstore
inputSpec: modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
templateDir: modules/openapi-generator/src/main/resources/go
nameMappings:
_type: UnderscoreType
type_: TypeWithUnderscore
http_debug_operation: HTTPDebugOperation
parameterNameMappings:
_type: underscoreType
type_: typeWithUnderscore
http_debug_operation: httpDebugOperation
additionalProperties:
enumClassPrefix: "true"
packageName: petstore
disallowAdditionalPropertiesIfNotPresent: false
generateInterfaces: true

View File

@@ -1,6 +1,6 @@
generatorName: go-server
outputDir: samples/server/petstore/go-server-required
inputSpec: modules/openapi-generator/src/test/resources/3_0/server-required.yaml
outputDir: samples/openapi3/server/petstore/go/go-petstore
inputSpec: modules/openapi-generator/src/test/resources/3_0/go-server/petstore_with_test_endpoint.yaml
templateDir: modules/openapi-generator/src/main/resources/go-server
additionalProperties:
hideGenerationTimestamp: "true"

View File

@@ -1,6 +1,6 @@
generatorName: go-server
outputDir: samples/server/petstore/go-chi-server
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/go-server/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/go-server
additionalProperties:
hideGenerationTimestamp: "true"

View File

@@ -1,4 +1,4 @@
generatorName: haskell
outputDir: samples/server/petstore/haskell-servant
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/haskell/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/haskell-servant

View File

@@ -1,6 +1,6 @@
generatorName: haskell-yesod
outputDir: samples/server/petstore/haskell-yesod
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/haskell/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/haskell-yesod
additionalProperties:
hideGenerationTimestamp: "true"

View File

@@ -0,0 +1,11 @@
generatorName: java
outputDir: samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml
library: microprofile
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
withXml: true
additionalProperties:
serializationLibrary: jackson
artifactId: microprofile-rest-client-3-jackson-with-xml
configKey: petstore
microprofileRestClientVersion: "3.0"

View File

@@ -0,0 +1,10 @@
generatorName: java
outputDir: samples/client/petstore/java/microprofile-rest-client-3.0-jackson
library: microprofile
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
serializationLibrary: jackson
artifactId: microprofile-rest-client-3-jackson
configKey: petstore
microprofileRestClientVersion: "3.0"

View File

@@ -6,3 +6,8 @@ templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
artifactId: echo-api-native
hideGenerationTimestamp: "true"
typeMappings:
OffsetDateTime: "Instant"
importMappings:
OffsetDateTime: "java.time.Instant"

View File

@@ -0,0 +1,16 @@
generatorName: java
outputDir: samples/client/petstore/java/okhttp-gson-3.1
library: okhttp-gson
inputSpec: modules/openapi-generator/src/test/resources/3_1/java/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
nameMappings:
_type: underscoreType
type_: typeWithUnderscore
parameterNameMappings:
_type: underscoreType
type_: typeWithUnderscore
additionalProperties:
artifactId: petstore-okhttp-gson-31
hideGenerationTimestamp: "true"
useOneOfDiscriminatorLookup: "true"
disallowAdditionalPropertiesIfNotPresent: false

View File

@@ -7,3 +7,4 @@ additionalProperties:
artifactId: petstore-okhttp-gson
hideGenerationTimestamp: "true"
supportStreaming: true
serializableModel: true

View File

@@ -1,8 +1,8 @@
generatorName: java
outputDir: samples/client/petstore/java/resteasy
library: resteasy
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
artifactId: petstore-resteasy
hideGenerationTimestamp: "true"
library: resteasy

View File

@@ -1,7 +1,7 @@
generatorName: java
outputDir: samples/client/petstore/java/resttemplate-withXml
library: resttemplate
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
java8: true

View File

@@ -1,7 +1,7 @@
generatorName: java
outputDir: samples/client/petstore/java/resttemplate
library: resttemplate
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
artifactId: petstore-resttemplate

View File

@@ -1,7 +1,7 @@
generatorName: java
outputDir: samples/client/petstore/java/vertx
library: vertx
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
artifactId: petstore-vertx

View File

@@ -5,3 +5,10 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/javascript/petstore-
templateDir: modules/openapi-generator/src/main/resources/Javascript
additionalProperties:
appName: PetstoreClient
modelNameMappings:
HealthCheckResult: HealthCheckStatus
parameterNameMappings:
query_1: queryOne
# the following has no effect as js client gen use baseName directly
nameMappings:
NullableMessage: nullable_field

View File

@@ -1,9 +1,13 @@
generatorName: julia-client
outputDir: samples/client/petstore/julia
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/julia/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/julia-client
additionalProperties:
hideGenerationTimestamp: "true"
packageName: OpenAPIGenPetStoreClient
exportOperations: "true"
exportModels: "true"
exportModels: "true"
modelNameMappings:
another_model: MappedModel
nameMappings:
another_property: mappedProperty

View File

@@ -1,9 +1,9 @@
generatorName: julia-server
outputDir: samples/server/petstore/julia
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/julia/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/julia-server
additionalProperties:
hideGenerationTimestamp: "true"
packageName: OpenAPIGenPetStoreServer
exportOperations: "true"
exportModels: "true"
exportModels: "true"

View File

@@ -0,0 +1,9 @@
generatorName: kotlin
outputDir: samples/client/petstore/kotlin-jvm-jackson
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
additionalProperties:
artifactId: kotlin-petstore-jvm-jackson
enumUnknownDefaultCase: true
serializationLibrary: jackson
library: jvm-retrofit2

View File

@@ -0,0 +1,7 @@
generatorName: kotlin
outputDir: samples/client/others/kotlin-jvm-okhttp-parameter-tests
library: jvm-okhttp4
inputSpec: modules/openapi-generator/src/test/resources/3_0/parameter-test-spec.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
additionalProperties:
artifactId: kotlin-petstore-okhttp4-parameter-tests

View File

@@ -0,0 +1,14 @@
generatorName: kotlin
outputDir: samples/client/petstore/kotlin-name-parameter-mappings
inputSpec: modules/openapi-generator/src/test/resources/3_0/name-parameter-mappings.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
nameMappings:
_type: underscoreType
type_: typeWithUnderscore
http_debug_operation: httpDebugOperation
parameterNameMappings:
_type: underscoreType
type_: typeWithUnderscore
http_debug_operation: httpDebugOperation
additionalProperties:
artifactId: kotlin-petstore-client

View File

@@ -0,0 +1,9 @@
generatorName: kotlin-server
outputDir: samples/server/petstore/kotlin-server/jaxrs-spec-mutiny
library: jaxrs-spec
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-server
additionalProperties:
returnResponse: "true"
interfaceOnly: "true"
useMutiny: "true"

View File

@@ -0,0 +1,7 @@
generatorName: kotlin-server
outputDir: samples/server/others/kotlin-server/jaxrs-spec
library: jaxrs-spec
inputSpec: modules/openapi-generator/src/test/resources/3_0/parameter-test-spec.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-server
additionalProperties:
useCoroutines: "true"

View File

@@ -0,0 +1,14 @@
generatorName: kotlin-spring
outputDir: samples/server/petstore/kotlin-spring-default
library: spring-boot
inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring
# comment out below to use default settings
#additionalProperties:
# documentationProvider: none
# annotationLibrary: none
# useSwaggerUI: "false"
# serviceImplementation: "true"
# serializableModel: "true"
# beanValidations: "true"
# useSpringBoot3: "true"

View File

@@ -4,3 +4,5 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/lua
additionalProperties:
packageName: petstore
nameMappings:
phone: mobile

View File

@@ -4,3 +4,7 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-e
templateDir: modules/openapi-generator/src/main/resources/perl
additionalProperties:
hideGenerationTimestamp: "true"
nameMappings:
NullableMessage: system_message
modelNameMappings:
DeprecatedObject: DeprecatedModel

View File

@@ -1,4 +1,11 @@
generatorName: php
outputDir: samples/client/petstore/php/OpenAPIClient-php
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/php/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/php
nameMappings:
_type: underscore_type
type_: type_with_underscore
type-: type_with_dash
parameterNameMappings:
_type: underscore_type
type_: type_with_underscore

View File

@@ -0,0 +1,4 @@
generatorName: php-nextgen
outputDir: samples/client/petstore/php-nextgen/OpenAPIClient-php
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/php-nextgen

View File

@@ -0,0 +1,12 @@
generatorName: php
outputDir: samples/client/petstore/php/psr-18
inputSpec: modules/openapi-generator/src/test/resources/3_0/php/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/php
library: psr-18
nameMappings:
_type: underscore_type
type_: type_with_underscore
type-: type_with_dash
parameterNameMappings:
_type: underscore_type
type_: type_with_underscore

View File

@@ -14,3 +14,7 @@ additionalProperties:
projectUri: https://github.com/OpenAPITools/openapi-generator
releaseNotes: 'This is a sample project'
tags: 'PetStore,powershell,sdk'
nameMappings:
name_mapping: SomethingElse
modelNameMappings:
model-mapping: NewModel

View File

@@ -4,6 +4,12 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/r/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/r
httpUserAgent: PetstoreAgent
library: httr2
modelNameMappings:
dummy_model: JustModel
parameterNameMappings:
path_array: path_array_parameter
nameMappings:
percent_description: percent
additionalProperties:
packageName: petstore
exceptionPackage: rlang
@@ -11,3 +17,4 @@ additionalProperties:
returnExceptionOnFailure: true
errorObjectType: "ModelApiResponse"
operationIdNaming: snake_case

View File

@@ -9,3 +9,9 @@ additionalProperties:
gemName: petstore
skipFormModel: "true"
strictSpecBehavior: false
nameMappings:
_type: underscore_type
type_: type_with_underscore
parameterNameMappings:
_type: underscore_type
type_: type_with_underscore

View File

@@ -0,0 +1,16 @@
generatorName: rust
outputDir: samples/client/petstore/rust/reqwest/name-mapping
library: reqwest
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/rust-name-mapping-test.yaml
templateDir: modules/openapi-generator/src/main/resources/rust
additionalProperties:
supportAsync: false
packageName: petstore-name-mapping
nameMappings:
_type: underscore_type
type_: type_with_underscore
-type: dash_type
parameterNameMappings:
_type: underscore_type
type_: type_with_underscore
-type: dash_type

View File

@@ -0,0 +1,7 @@
generatorName: scala-akka-http-server
outputDir: samples/server/petstore/scala-pekko-http-server
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/scala-akka-http-server
additionalProperties:
artifactId: openapi-scala-pekko-http-server
useApachePekko: true

View File

@@ -2,5 +2,13 @@ generatorName: scala-sttp
outputDir: samples/client/petstore/scala-sttp
inputSpec: modules/openapi-generator/src/test/resources/3_0/scala/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/scala-sttp
nameMappings:
_type: "`underscoreType`"
type_: "`typeWithUnderscore`"
http_debug_operation: "`httpDebugOperation`"
parameterNameMappings:
_type: underscoreType
type_: typeWithUnderscore
http_debug_operation: httpDebugOperation
additionalProperties:
artifactId: scala-sttp-petstore

View File

@@ -0,0 +1,12 @@
generatorName: spring
outputDir: samples/server/petstore/springboot-reactive-noResponseEntity
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
artifactId: springboot-reactive-noResponseEntity
documentationProvider: springfox
reactive: "true"
hideGenerationTimestamp: "true"
delegatePattern: "true"
useResponseEntity: "false"

View File

@@ -0,0 +1,13 @@
generatorName: spring
library: spring-cloud
outputDir: samples/client/petstore/spring-cloud-deprecated
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-deprecated-fields.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
documentationProvider: springdoc
artifactId: spring-cloud-deprecated
interfaceOnly: "true"
singleContentTypes: "true"
hideGenerationTimestamp: "true"
useTags: "true"

View File

@@ -10,3 +10,12 @@ additionalProperties:
nonPublicApi: true
projectName: PetstoreClient
podHomepage: https://github.com/openapitools/openapi-generator
nameMappings:
_type: underscoreType
type_: typeWithUnderscore
-type: dashType
parameterNameMappings:
_type: underscoreType
type_: typeWithUnderscore
-type: dashType

View File

@@ -1,7 +0,0 @@
generatorName: ada
outputDir: samples/client/petstore/ada
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/Ada
additionalProperties:
modelPackage: Samples.Petstore
projectName: Petstore

View File

@@ -1,6 +0,0 @@
generatorName: python-flask
outputDir: samples/openapi3/server/petstore/python-flask-python2
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-object-as-parameter.yaml
templateDir: modules/openapi-generator/src/main/resources/python-flask
additionalProperties:
supportPython2: true

View File

@@ -413,10 +413,18 @@ One can map the property name using `nameMappings` option and parameter name usi
Here is an example to use `nameMappings` and `parameterNameMapping` in CLI:
```sh
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml -o /tmp/java2/ --name-mappings _type=underscoreType, type_=typeWithUnderscore, --parameter-name-mappings _type=paramType, type_=typeParam
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml -o /tmp/java2/ --name-mappings _type=underscoreType,type_=typeWithUnderscore, --parameter-name-mappings _type=paramType,type_=typeParam
```
(Not all generators support this feature yet. Please give it a try to confirm the behaviour and open an issue (ticket) to let us know which generators you would like to have this feature enabled and we'll prioritize accordingly.)
To map model names, use `modelNameMappings` option, e.g.
```sh
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g csharp -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o /tmp/csharp/ --model-name-mappings Tag=Label
```
will rename the `Tag` schema to `Label` instead.
Not all generators support thess features yet. Please give it a try to confirm the behaviour and open an issue (ticket) to let us know which generators you would like to have this feature enabled and we'll prioritize accordingly. We also welcome PRs to add these features to generators. Related PRs for reference: #16209, #16234 (modelNameMappings), #16194, #16206 (nameMappings, parameterNameMappings).
NOTE: some generators use `baseName` (original name obtained direclty from OpenAPI spec, e.g. `shipping-date`) mustache tag in the templates so the mapping feature won't work.
## Schema Mapping
@@ -536,7 +544,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
Example:
```
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/enableKeepOnlyFirstTagInOperation_test.yaml -o /tmp/java-okhttp/ --openapi-normalizer SET_TAGS_FOR_ALL_OPERATIONS=true
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/enableKeepOnlyFirstTagInOperation_test.yaml -o /tmp/java-okhttp/ --openapi-normalizer SET_TAGS_FOR_ALL_OPERATIONS=another_tag_name
```
- `ADD_UNSIGNED_TO_INTEGER_WITH_INVALID_MAX_VALUE`: when set to true, auto fix integer with maximum value 4294967295 (2^32-1) or long with 18446744073709551615 (2^64-1) by adding x-unsigned to the schema

View File

@@ -50,6 +50,7 @@ The following generators are available:
* [perl](generators/perl.md)
* [php](generators/php.md)
* [php-dt (beta)](generators/php-dt.md)
* [php-nextgen (beta)](generators/php-nextgen.md)
* [powershell (beta)](generators/powershell.md)
* [python](generators/python.md)
* [r](generators/r.md)

View File

@@ -197,6 +197,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>string</li>
<li>struct</li>
<li>switch</li>
<li>system</li>
<li>this</li>
<li>throw</li>
<li>true</li>

Some files were not shown because too many files have changed in this diff Show More