21189 Commits

Author SHA1 Message Date
sandwoodK
13c95f1dd2
Fix nim compilation in case a edge case of a schema with enum (#20780)
If enum constraint contains one value which is not a valid nim
identifier, we must surround this identifier with backtick.
2025-05-20 15:38:58 +08:00
Andreas Kuhtz
78b54b9283
Fix broken build on Windows OS if the schema contains references to other schema files. (#21300) 2025-05-20 10:06:01 +08:00
CHervaudBetclic
0aaeb45dbe
[kotlin-client] Add support for integer enums in serialization for kotlin-client (#21248) 2025-05-19 08:43:24 +01:00
Guillaume Turri
6e2b4f99ba
[PHP-Symfony] revamp the computation of the contentType (#21292)
recent commit 40894382fc9fe959f3beacd20cfd6421eaf840b0 already improved
that method: before that other commit it was juste impossible to query
a endpoint with a response type that was something else than
application/json or application/xml. With that commit it became possible
to query such endpoint provided that the client declare in its Accept
header that it can cope with */* (or provided that the client omitted
that header altogether).

But there were still cases badly handled. For instance if an endpoint
returns a response of type image/png and that it receives a query with
header "Accept: image/png", then it would reply with 406.

To avoid any other issue with type resolution, this commit revamps the
getOutputFormat function more thoroughly and does it by implementing
the specification available at
https://httpwg.org/specs/rfc9110.html#field.accept ), which means that
the format accepted by the client are ordered by the relative weights
specified it specified.
2025-05-19 10:09:16 +08:00
Rens Groothuijsen
45047b77f1
[python-fastapi] Upgrade dependencies to support Python 3.13 (#21291) 2025-05-18 09:56:24 +08:00
William Cheng
b3935922cd
update snakeyaml version to 2.4 (#21293) 2025-05-17 13:49:09 +08:00
Andrew Wilson
9b39c05563
Kotlin Misk Add Extra Parameters (#21271)
* first pass

* squash

* fixing FILES
2025-05-16 14:37:49 +08:00
Jens Balvig
cfe0b6fae3
Fix spelling mistake in validations (#21287) 2025-05-16 13:55:18 +08:00
Guillaume Turri
6c0e7274ea
[Php-Symfony] showcase recent features in petstore.yaml (#21286)
PR #21261 added support for endpoint with response of type text/plain
or even image/png.

This commit adds such endpoint so that:
- the way those are supported is clearer (as it is now directly visible
  in the generated sample files)
- if a future commit impacts this part of the generation it will be easier
  to assess that impact
2025-05-16 10:32:52 +08:00
Peter Storch
5b885cd3db
[kotlin-spring] fix validation regression in kotlin-spring generator (#21255)
* fix #21238 regression in kotlin-spring generator

* add tests for issue #21238
2025-05-16 00:08:51 +08:00
Ondřej Šimon
68c1d8970e
[20808] add Autowired annotations guard to skip generation (#21198)
annotation import and usage is not generated when API is not a Spring Bean
2025-05-15 18:51:25 +08:00
Sohaib Athar
bd8a206ebd
fix(cpp-qt-client): add asJsonObject method to OAIEnum class (#19307) (#21211)
* add asJsonObject method to OAIEnum class to fix enum handling in query parameters

* update samples

---------

Co-authored-by: William Cheng <wing328hk@gmail.com>
2025-05-15 14:00:55 +08:00
William Cheng
0bfce24071
Add model name mapping option to rust generators (#21282)
* add model name mapping option to rust generators

* update package name

* update samples
2025-05-15 13:29:37 +08:00
Guillaume Turri
40894382fc
[php-symfony] fix handling of endpoints with "text/plain" or "image/png" response type (#21261)
* [php-symfony] Never return 406 when user accepts */*

When a query has header "Accept" set to "*/*" it means it accepts
everything. It is hence weird to return a 406.
This patch ensures it does not occur: when the query accepts everything
then we take any produced type.

This fixes #13334. This also partly makes the open PR #15560 obsolete
(or at least, it provides a workaround)

* [php-symfony] Don't crash at runtime on null convertFormat

$this->convertFormat may return "null". When it's the case we end up
calling

    ...->serialize($data, null);

but this crashes at runtime because that serialize method declares that
the 2nd parameter is of type "string" (so null is not accepted).

With this patch we avoid having an error 500. Instead we return something
that makes perfect sense when the OpenApi specification declares a content
of type "text/plain" and that the returned value is for instance a string,
an int, or a boolean.

* [php Symfony] fix return type for non json/xml api

This fixes the generated returned type of controller methods for
endpoint with a response declared like

    content:
      text/plain:
        schema:
          type: <boolean|string|integer|number>

or for

    content:
      image/png:
        schema:
          type: string
          format: binary

Without this commit the generated method *had to* return a value that
matched "array|object|null", which does not work in this case.
This commit makes it possible to return the proper type.
2025-05-14 21:11:39 +08:00
Amin Ya
429da9860b
[rust] support model/maps as deep/explode params (#21262)
* [rust] support model/maps as deep/explode params

* [rust] add tests for rust deep objects

* [rust] detect normal non deep objects

* [rust] distinguish model and object

* [rust] fix objects as params for hyper
2025-05-14 14:44:05 +08:00
jglagrimas
a0b9ecd773
[php-laravel generator] update $request->bool to $request->boolean (#21273)
* Chores : update $request->bool to $request->boolean

$request->bool is not a laravel function should be $request->boolean()

* Chores : update FakeController.php $request->boolean()
2025-05-14 14:37:16 +08:00
William Cheng
2fb26c362e update kotlin samples 2025-05-11 23:43:24 +08:00
Ross Sullivan
9981a408d1
[kotlin] Added path sanitization in javadoc comments (#20767)
* [kotlin] Added path sanitization in javadoc comments

* added sample as regression test

* Added samples/client/others/kotlin-jvm-okhttp-path-comments to github workflow
2025-05-11 23:23:50 +08:00
Mostafa Aghajani
91630b8591
feat: add default values support to Avro schema generator with related test cases (#21226) 2025-05-11 22:48:53 +08:00
Alex B
57bf6925bb
[Java] Make Java ApiClient extendable (#21251)
* Make all Java ApiClients in templates extendable

* Make all Java ApiClients in samples extendable

* Fix compilation of enum constructor

* Fix compilation of enum constructor in templates
2025-05-11 22:47:40 +08:00
Jonas Renggli
be17698320
[php-flight] fix: remove trailing spaces (#21254)
According to the Guidelines for Contributing
(https://github.com/OpenAPITools/openapi-generator/blob/master/CONTRIBUTING.md)
generated PHP code should conform to PSR-12
(https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md).

There are some minor violations regarding the following rule

> There MUST NOT be trailing whitespace at the end of lines.

This change removes trailing spaces in generated code.
2025-05-11 22:32:27 +08:00
DavidGrath
2fd1ee66cc
Added ANTLR. Fix Issue #20960 (#21230)
* Added ANTLR. Started work on issue 20960

* Ran generation scripts

* Excluded ANTLR generated files from JavaDoc generation

* Whitespace fix
2025-05-11 22:31:54 +08:00
Jonas Renggli
6344bfa779
[php-flight] fix: use static PHPUnit assertions (#21253)
Static analysis tools such as PHPStan report errors when dynamic calls are used
for static methods.

```
ERROR Dynamic call to static method PHPUnit\Framework\Assert::assertEquals().
```

According to the source code of PHPUnit
(https://github.com/sebastianbergmann/phpunit/blob/9.5.0/src/Framework/Assert.php)
the function is indeed static.

```php
public static function assertTrue($condition, string $message = ''): void
```

This change updates to PHP Flight test template `register_routes_test.mustache`
to use static calls for PHPUnit assertions.
2025-05-11 22:22:34 +08:00
Amin Ya
66e8c932c3
[cpp-rest-sdk] support serializing model base as parameters (#21235)
* [cpp-rest-sdk] support serializing models as parameters

This fixes the code generation for the cases where the model is referenced as a parameter

* [cpprest-sdk] avoid newlines when no model import
2025-05-11 21:52:09 +08:00
Billy Booth
d6c4634269
[csharp] Add missing ConfigureAwait(false) for csharp generator (#21244)
* [csharp] ApiClient.mustache: Apply ConfigureAwait(false) consistently

* [csharp] Update samples to include 59936f29f00
2025-05-09 12:02:38 +08:00
Eric Rolli
bb811db2a2
[JavaJaxRs] generate getValue() for enums with the correct type (#21183)
* [JavaJaxRs] enumClass.mustache added getValue()

JavaJaxRs enums are missing getValue() method returning the correct data type.

* Update InlineObject2.java added getValue() for enums

* Update Pet.java added getValue() to enum

* Update BigCat.java added getValue for enum

* Update EnumArrays.java added getValue() to enum

* Update EnumArrays.java added getValue() to enum

* Update EnumTest.java added getValue() to enums

* Update MapTest.java added getValue() to enum

* Update Order.java added getValue() to enum

* Update Pet.java added getValue() to enum

* Update EnumArrays.java added getValue() to enums

* Update EnumTest.java added getValue() to enums

* Update MapTest.java added getValue() to enum

* Update Order.java added getValue() to enum

* Update ParentWithNullable.java added getValue() to enum

* Update BigCat.java added getValue() to enum

* Update EnumArrays.java added getValue() to enums

* Update EnumTest.java added getValue() to enums

* Update MapTest.java added getValue() to enum

* Update Order.java added getValue() to enum

* Update Pet.java added getValue() to enum

* Update BigCat.java added getValue() to enum

* Update EnumArrays.java added getValue() to enums

* Update EnumTest.java added getValue() to enums

* Update MapTest.java added getValue() to enum

* Update Order.java added getValue() to enum

* Update Pet.java added getValue to enum

* Update EnumArrays.java added getValue() to enum

* Update EnumTest.java added getValue() to enums

* Update MapTest.java added getValue() to enum

* Update Order.java added getValue() to enum

* Update ParentWithNullable.java added getValue() to enum

* Update Pet.java added getValue() to enum

* Update EnumTest.java getValue() with Integer

* Update EnumTest.java
2025-05-09 11:15:20 +08:00
martin-mfg
b55ae3caa8
update documentation about lambdas (#21241) 2025-05-09 11:00:53 +08:00
ksn-partisia
ecd5d253a8
[Bug] [Java] Fix java compilation warnings in RFC3339JavaTimeModule and RFC3339InstantDeserializer (#21243)
* Fix java compilation warnings in RFC3339JavaTimeModule and RFC3339InstantDeserializer

* Regen missing samples
2025-05-09 11:00:07 +08:00
Philip Thomas Casado
4cffd32f87
[Feat][Typescript Angular] Implement deepObject query params (OAS3.0) (#21108)
* feature: implement deepObject query params as per documentation.
Closes OpenAPITools/openapi-generator#19342.

* chore: regenerate samples.

* chore: symplify code (via @joscha)

* chore: regenerate samples

* test: add integration test for typescript-angular deepObject query params

* fix: typo in the integration tests path

* chore: use node v18 for integration tests

* chore: make ES6 compliant

* chore: make test name semantically accurate

* chore: regenerate samples

* test: add angular v16 deep-object test

* chore: delete previous bespoke test for deep objects (uses test introduced in 71629f8d9a instead)

* chore: restore missing OAS for deep object API tests

* test: move angular deepObject tests to v19 and delete v16 ones

* test: atomic deepObject test on service rather than integration with app component

* chore: clean up superfluous import
2025-05-07 16:40:02 +02:00
Juanpe Araque
f2813716fb
[Python] Add __all__ variable in the package __init__.py file for Python APIs (#21185)
* Add __all__ to the package __init__.py file for Python APIs

* Remove empty line before closing bracket

* Add missing samples
2025-05-07 15:59:49 +08:00
Amin Ya
3048fb02e1
[cpp-rest-sdk] remove U macro definition from public headers (#21221)
Cpprest has a public U macro definition that causes build errors in libraries as U is a common name for template parameters. This PR fixes the issue by turning it off.

[microsoft/cpprestsdk@411a109/Release/include/cpprest/details/basic_types.h#L87](411a109150/Release/include/cpprest/details/basic_types.h (L87))

Related to https://github.com/microsoft/cpprestsdk/issues/1805 and https://github.com/fmtlib/fmt/issues/4180
2025-05-07 15:08:38 +08:00
martin-mfg
5117616b53
CodegenOperation & CodegenProperty: turn fields into getters (#21225)
* turn fields into getters

* update samples
2025-05-07 15:04:04 +08:00
William Cheng
5e5a053bfa
update PR tempalte, issue template, link to validator (#21232) 2025-05-07 14:39:37 +08:00
Amin Ya
f5b8fd6f5e
[cpp-rest-sdk] fix finding of the crypto libraries (#21219)
* [cpp-rest-sdk] fix finding of the crypto libraries

This fixes finding of the crypto for cpprest sdk via find_library. It also bumps the minimum CMake version to 3.10 to avoid deprecation warnings

* docs: add myself as a technical committee member
2025-05-07 14:30:18 +08:00
Amin Ya
4b2abdf48d
fix: fix dev container failing to build (#21218)
The dev container fails to build because of the outdated docker-in-docker feature. This updates the docker-in-docker and fixes the build. I also updated the docker compose references in the docs.
2025-05-05 15:34:02 +08:00
William Cheng
2010c2a60a
Add workflow to test Elixir clients (#21214)
* add elixir workflow

* update

* fix

* add elixir workflow (#21215)

* update tests to use built-in json module instead of jason

* update base_url

* temporarily disable type-casting for dates

* retry failing tests

* update spec to use localhost

* add petsore local server to workflow

---------

Co-authored-by: Enrique Fernández <enrique@bluelabs.eu>
2025-05-05 15:32:05 +08:00
devhl-labs
41012588dd
ignore date length validation (#21217) 2025-05-05 15:06:22 +08:00
martin-mfg
e22d079bb0
ensure correct value for hasParams (#21209)
* turn hasParams into getter

* restore hasRequiredParams
2025-05-05 00:49:01 +08:00
Enrique Fernández
d38898a4d0
fix: delete unused file (#21213) 2025-05-04 23:39:17 +08:00
Ross Sullivan
652d4ed95c
Remove duplicate oneOf schemas during pre-processing (#21174)
* fix: Remove duplicate oneOf schemas during pre-processing

* chore: Updated samples

* fix: Fixed regression with oneOf+discriminator

* fix: Fixed possible null pointer during schema preprocessing

* refactor: Moved oneOf deduplication to OpenAPINormalizer
2025-05-04 23:30:42 +08:00
Devon
104ceb9c16
Java: Optimize HashSet Initialization (#21205)
* Optimize HashSet Initialization

Noticed this while debugging - we can avoid wasting memory/cpu creating 16 buckets when we only need one or a few.

* generate samples

* use Arrays.asList
2025-05-04 22:56:33 +08:00
Enrique Fernández
0389a99cec
simplify connection module (#21158) 2025-05-04 22:51:35 +08:00
devhl-labs
f3af25b10c
fixed encoding (#21207) 2025-05-04 22:30:40 +08:00
devhl-labs
56fe7e3286
[csharp] Fixed duplicate property names (#21206)
* fixed duplicate property names

* discard samples

* discard samples

* added new sample
2025-05-04 22:29:12 +08:00
Enrique Fernández
ac77339fcd
[chore][elixir] update dependencies (#21210)
* chore: bump tesla version

* chore: bump ex_doc version

* chore: bump dialyxir version
2025-05-04 22:27:26 +08:00
Jaime Sánchez
3c664d1a59
[java] [spring] Fix multipart optional params error compilation using delegates (#20793)
* fix spring multipart optional parameters

* use optional only in not required params

* remove debug line

---------

Co-authored-by: Jaime Sanchez <jaime.sanchezf@externos.santalucia.es>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2025-04-30 14:28:38 +08:00
Andrew Wilson
76540e591f
Improve Kotlin Misk OpenApi Generator (#21165)
* first pass

* fixing types

* fixing action

* updating samples

* updating files

* adding guido

* fixing misk

* removing old files

* cleaning generated files

* cleaning generated files

* adding back in license

* first pass

* second pass

* third pass

* typo

* fixup

* fixup 2

* fixup 3

* fixup 4

* fixup 5

* fixup 6

* fixing api override

* fixing docs

* fixing docs json

* fix misk version

* add action prefix

* fixup

* fixup 2

* fixup 3

* fixup 4

* fixup 5
2025-04-30 01:53:32 +08:00
kenji yoshida
56eb8f7bc9
update akka-http and pekko-http server generator and example (#21166) 2025-04-30 01:46:49 +08:00
Akihito Nakano
3bac186b2f
Fix the layout issue in the donation message (#21184)
The emoji might not render correctly for Windows users.
2025-04-30 01:45:41 +08:00
William Cheng
d04c0ddbb4
minor fix to javadoc (#21177) 2025-04-29 15:58:16 +08:00