13408 Commits

Author SHA1 Message Date
Axident
e2df0d6154
#18095 | Prevent generating "pattern" and "size" to special formats of string type (#18135) 2024-03-20 14:07:29 +08:00
William Cheng
971c3a6059
Insert missing quote in clientPropertiesConfiguration.mustache for the Spring generator (#18172)
* #18090 Insert missing quote: `{{{tokenUrl}}}"` -> `"{{{tokenUrl}}}"`

* #18058 Added test unit

* #18058 Stop unit test from generating unnecessary APIs

* fix test

---------

Co-authored-by: Flemming Nørnberg Larsen <f.larsen@elsevier.com>
2024-03-20 14:06:16 +08:00
William Cheng
09af44eca3
[java] update jakarta.validation-api to 3.0.2 (#18124)
* fix: jersey3 library

fix issue that library failed in case pattern matching was used in
the api.

* add tests, update version

* update

* fix tag

* fix, update samples

* update build

* more update

* update workflow

* test useJakarta

---------

Co-authored-by: holomekc <30546982+holomekc@users.noreply.github.com>
2024-03-20 12:55:19 +08:00
condorcorde
de081e4edf
Fix proxy type (#18166)
* Update configuration.mustache

Fix check of proxy type

* Changing sample source files
2024-03-20 12:53:58 +08:00
Samuel Kahn
783119b687
[cpp-ue4] Handled nullable by setting the required tag, effectively making nullables optionals (even if they may be required in the spec). This is because there is no such concept as a value being nullable in C++, and this generator deals with values, not pointers. (#18168)
Co-authored-by: Samuel Kahn <samuel@darewise.com>
2024-03-20 11:26:54 +08:00
Giovanni Cimolin da Silva
93b76dde37
fix: Fix schema generation for oneOf when using TS-FETCH client (#18154)
* fix: Fix schema generation for `oneOf` when using TS-FETCH client

This fixes the following errors:
* Spread types may only be created from object types (on `FromJSONTyped` functions).
* Module '"./BlankEnum"' has no exported member 'instanceOfBlankEnum' (enum templaces don't export function used by other API client files).

* chore: Regenerate samples
2024-03-19 11:48:21 +01:00
William Cheng
191dc1a6ba
Override escape reserved word in abstract rust (#17440)
* override escape reserved word in abstract rust

* add tests for ref, improve verion lambda

* add files
2024-03-19 18:33:29 +08:00
Poolmann
b7ea139f77
[Python] Fix object serialization for multipart requests (#18140)
* Fix multipart object serialization

* Update samples
2024-03-19 18:31:08 +08:00
Beppe Catanese
e58f19c735
[POSTMAN] Process request with array of string (#18159)
* Process JSON array

* Update test file

* Regenerate samples

* Add CI test
2024-03-19 18:29:48 +08:00
adrianhelvikspond
815205250a
Fix: Incorrect serialisation of maps and sets in typescript-axios (#17790) 2024-03-19 08:21:39 +01:00
Jonas Emmert
5f49a04190
allow api response to be NULL and regenerate samples (#18141) 2024-03-19 10:03:17 +08:00
William Cheng
ddb5ab4078
Add name in various cases in property, parameter names (#18139)
* create nameInPascalCase

* add back name in camel case

* update abstract cpp codegen

* update erlang templates, update samples

* update tests

* add param names in various cases

* clean up

* fix
2024-03-19 09:27:02 +08:00
William Cheng
3155a70c3f
[Refactor] create a static function to build map of codegen model (#18138)
* refactor to build map of codegen model

* update
2024-03-19 09:15:33 +08:00
Ross Bender
b59957a095
Java API invocation flexibility (#18078)
* add direct invocation methods for java (httpclient)

* add direct invocation methods for java (resttemplate)

* handle methods only if endpoints exist for api client

* preserve previous newline to minimize changes

* update httpclient/resttemplate samples

* add common methods in base class

* regenerate samples with base class
2024-03-18 21:51:32 +08:00
devhl-labs
da1187fc8d
[csharp] Fixes incorrect property name (#18136)
* moved camel case lambda

* renamed camel case lambda

* reverted unintended change

* fixed wrong property names

* restored accidental file deletion

* build samples
2024-03-18 13:02:26 +08:00
devhl-labs
96fad5eb2c
[csharp] Fix getModelFromParameter (#18137)
* fix getModelFromParameter

* minor fix
2024-03-18 12:54:49 +08:00
devhl-labs
12849cccbe
Camel case lambda does too much (#18131)
* moved camel case lambda

* renamed camel case lambda

* reverted unintended change
2024-03-17 16:42:11 +08:00
William Cheng
c5ab78575a
Add rule to set container (array, set, map) to true (#18128)
* add rule to set containter to null

* update doc
2024-03-17 16:37:46 +08:00
Tomohiko Ozawa
0b4cf0a027
[typescript-fetch] Omit readOnly properties from request models (#18065)
* omit readOnly properties on requests

* update the sample
2024-03-16 09:27:39 +01:00
dvacca-onfido
ae9598dcfc
fix(typescript-axios): Serialize boolean to string in form-data file upload (#18084) 2024-03-16 09:20:48 +01:00
William Cheng
d1ccabbe7e update file header 2024-03-16 15:34:52 +08:00
ふぁ
3137b3da77
[python-pydantic-v1] Fix unnamed dicts with additional properties (#18112)
* [python-pydantic-v1] pick #16779

* [python] update sample
2024-03-16 15:26:06 +08:00
Daniel Karlsson
fbe81f0735
Add new uncamelize lambda (#18109)
Co-authored-by: Daniel Karlsson <daniel.karlsson@cinnober.com>
2024-03-16 15:23:10 +08:00
William Cheng
41dbe51575
update protobuf to newer version (go gin) (#18123) 2024-03-16 14:59:47 +08:00
Petar Karadzhov
4f4237393f
[dart] fix: Bearer and Basic auth interceptors case-insensitive scheme comparison (17073) (#17074)
* [dart] fix: Bearer and Basic auth interceptors case-insensitive scheme comparison

* Update samples
2024-03-16 10:49:43 +08:00
Beppe Catanese
cb75fa0d9e
[POSTMAN] Genarate Postman requests from inline examples (#18086)
* Process inline examples (if available)

* Test generation with inline examples

* Update samples

* Move test to CI testing suite
2024-03-14 21:03:31 +08:00
Dennis Melzer
5ed2283e01
Fix model generation of array with items unique = true (#18104)
* Fix optional empty collection as default

* Fix test

* Fix test

* Fix default value collection handling
2024-03-14 20:51:11 +08:00
Dennis Melzer
96bf7ac915
Fix default empty collections when collection is optional (#18080)
* Fix optional empty collection as default

* Fix test

* Fix test
2024-03-14 20:28:27 +08:00
Jonas Emmert
6075b8a8f1
[R][Client] Fix api response, JSON for maps and let httr2 api client handle empty response bodies (#18049)
* changed files from rebuilding project and updating samples

* change default value of from_encoding to empty string

- from_encoding = NULL is invalid and produces an error, as only strings are allowed, see https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/iconv
- defaulting to an empty string fixes this issue

* fix map being surrounded by quotes in json

* allow httr2 client to deal with empty response body

* changed files from rebuilding project and updating samples

* added PetMap schema for test of correct map serialization in toJSONString and regenerated samples
2024-03-13 15:30:58 +08:00
javiarellanoo
7e8de912a7
Update ExampleGenerator.java (#18003)
Renamed the DATE_FORMAT field in order to follow convention
2024-03-13 15:02:08 +08:00
ふぁ
1586c698c9
[python] Fix multipart requests with type file fails with binary data (#18079)
* [python] fix Multipart requests with type file fails with binary data #18073

* [python] update sample
2024-03-12 19:24:55 +08:00
Timo von Holtz
5975e6c5b0
Haskell: JSON Query parameters (#18047)
* Allow json encoded query paramters

* Also fix haskell-http-client

* Regenerate haskell samples
2024-03-12 15:35:18 +08:00
denisbog
6251aa17ef
[RUST-AXUM] fix generator not handling application/x-www-form-urlencoded request content (#18061)
* fix OpenAPITools/openapi-generator#18060

* isolate the option as separate flag

* apply modification suggested by @wing328

* remove added newlines
2024-03-12 15:17:30 +08:00
ふぁ
678db1e4af
[python] json like str response (#18069)
* [python] json like str response

* [python] fix response deserialize

* [python] update sample

* [python] fix echo_api test quotes
2024-03-11 20:27:26 +08:00
BaptisteSaves
82fcf28a2b
Remove pydantic warnings when using model_dump by fixing one_of_schemas type (#17941) 2024-03-11 20:26:46 +08:00
William Cheng
7f1e79f7d2
[C] Optimize memory usage when printing JSON (#18072)
* cJSON generate unformatted json to save memory during large objects handling

* update sample

* add option to use cjson print unforamtted in client

* remove unused test template files

* add new samples

* update workflow

* update doc

* fix model filename

* fix inclulde

---------

Co-authored-by: Hemant Zope <42613258+zhemant@users.noreply.github.com>
Co-authored-by: Hemant Zope <hemantzope2008@gmail.com>
2024-03-11 16:18:08 +08:00
William Cheng
4ff7e0ec3f
Prepare 7.5.0 snapshot (#18068)
* Revert "7.4.0 release"

This reverts commit eda049348425171df772a7b9087cc97db718cfda.

* prepare 7.5.0 snapshot version

* update samples

* update doc
2024-03-11 11:10:52 +08:00
William Cheng
2abcb4f7f0
7.4.0 release (#18067) 2024-03-11 10:11:15 +08:00
linxin1019
20bd649bf9
Add enum name mapping feature to typescript generators (#18064)
* feat: add enum mapping for typescript

* revert unnecessary change
2024-03-10 23:28:33 +08:00
swcm-mnestler
0bc979ebdc
[typescript-nestjs] Compatability with tsc 'strict' flag (#17672)
* [typescript-nestjs] Compatability with tsc 'strict' flag

* Update samples / docs
2024-03-09 17:16:29 +01:00
dabdirb
93aec4d89d
Fix #17831 @lombok.NonNull on all required fields when any lombok annotation is included (#17861)
* fix #17831 @lombok.NonNull on all required fields when any lombok annotation is included

* fix #17831 @lombok.NonNull on all required fields when any lombok annotation is included
2024-03-09 17:44:10 +08:00
hahny93
033993c63d
[Kotlin Spring] fix template request part and description (#17821)
* [kotlin-spring] Parameter Name and Description are now used properly in multipart form endpoints

* [kotlin-spring] Parameter Name and Description are now used properly in multipart form endpoints (generated docs and samples)

* [kotlin-spring] Parameter Name and Description are now used properly in multipart form endpoints (generated docs and samples)

---------

Co-authored-by: Kevin Hahn <kevin.hahn@partner.ionity.eu>
2024-03-09 17:43:27 +08:00
William Cheng
494fc7d182
[kotlin] Enum should match spec (#18062)
* [kotlin] Enum should match spec

Adjust the enum generation to match what is in the spec, rather than
camel-casing it.
Add tests for capitalization scenarios, including for kotlin keywords

* [kotlin] export docs generators for enum change

* [kotlin] export docs generators for enum change

* fix conflicts

---------

Co-authored-by: Tyler B. Thrailkill <tylerbthrailkill@gmail.com>
Co-authored-by: Jari Nystedt <jari.nystedt@tietoevry.com>
2024-03-09 17:42:33 +08:00
julien Lengrand-Lambert
f1fcceb375
Major Jetbrains HTTP Client upgrade. Move to BETA (#15779)
* Add notes to requests for better readability

* Adds extra configs for jetbrains http client for testing

* Adding new sample data

* Changes

* Setting up test infrastructure

* Adds body to requests.

* Fixing some bugs in map traversal

It'd be much better to use a proper library for this though

* Adding secret file to gitignore

* Adds github spec, for complex example.

Add null check to avoid errors in example extraction

* Add support for custom variables in request body

* Add support for all basic Auth headers

* Not sure whaet happened with my api mustache file

* Add support for custom headers

* Fixes empty lines issue

* Adds support for Accept header

* Adding many tests, deleting experiment files

* Updates generator doc

* Completes README file with extra information

* Runs generate-samples and export docs

* Running sample generation

* Adding missing files to samples

* Removing forgotten stdout statements

* Ignore one test making the docker image generation fail
2024-03-09 16:56:26 +08:00
William Cheng
93d5fc646b update kotlin server tests 2024-03-09 16:51:52 +08:00
Ross Bender
cf2435f335
Add support for controlling output of OpenAPI Generator version in generated files (#17952)
* add initial openapi config and java generated files

* add java implementation for adding generator version

* regenerate sample client files

* remove tabs

* only show generated version if build info exists

* set build info for batch generation

* update generator doc for new global flag

* use existing property for generator version

* update templates to include generator version

* update templates for better generator version syntax

* revert undesired changes

* regenerate samples for openapi client

* update templates to correct formatting/newlines

* correct description text and add to usage doc

* add generator cli option for all codegen types

* use more concise version info; update existing codegens to support new prop

* correct wrong prop reference

* add initial test coverage for new prop

* update last (scala) templates with new prop

* update samples after upstream merge

* use consistent version output

* use better sample project id/name

* revert using option for generator version in templates
2024-03-09 15:52:08 +08:00
andreas-wirth
c87ad561f1
inputSpec should not be mandatory when inputSpecRootDirectory is set (#18000)
* Fix inputSpec to not be mandatory in maven plugin

* Add unit tests
2024-03-09 15:34:13 +08:00
Tomohiko Ozawa
5d959eeae6
[typescript-fetch] Use == to check property is null or undefined (#17972)
* use `==` operator to check null or undefined

* update the sample
2024-03-09 15:28:36 +08:00
Prashant Pant
31cff44206
Autoset constants (Required fields having single valid enum value) C# Implementation of #16547 (#17954)
* Autoset constants (Required fields having single valid enum value) C# Implementation

* Update generichost/api.mustache & httpclient/api.mustache to autoset singleton enums values.
2024-03-09 15:07:26 +08:00
Oscar Reyes
7d9f9d7e81
[kotlin-spring] Fix cookie parameter code generation in API (#17959)
* + Cookie parameter generation fixed

* Added cookie parameter mustache template for generating cookie related code
* Adapted kotlin-spring api templates to include cookie parameters
* Added tests for evaluating cookie parameter code generation
* Added configuration sample for the new cookie use case

* - Unused fake cases removed

* Removed fake cases from openapi spec that were not related to cookie usage
* Cleaned sample files
2024-03-09 14:34:12 +08:00