2472 Commits

Author SHA1 Message Date
William Cheng
5f39bd230e
update undertown to 2.3.17.FINAL (#19734) 2024-10-01 16:54:49 +08:00
Nelson Vides
7e1ebe6404
Erlang server (#19722)
* Add documentation to server and handlers

* Respond to at least one path-server

* Let url servers override base path

* Handle reading bigger bodies in cowboy

* Improve json error handling

* Regenerate erlang-server handlers

* Rework API module for performance and completion

* Regenerate erlang-server handlers
2024-10-01 14:51:12 +08:00
winkler-pixop
2551689ec6
Fix #19683 : Generated code fails to build with x86_64-linux-gnu-g++-13 (#19684)
* Add C++ header for cpp-pistache-server to fix breaking CMake build of generated code.

* Sort includes of system C++ headers for cpp-pistache-server.

* Add samples generated from fixing bug #19683.
2024-10-01 14:00:38 +08:00
Stefan Koppier
df22ca6dcc
[BUG] Kotlin wiremock query params are incorrect (#19720) 2024-09-30 11:44:08 +01:00
Joscha Feth
0b32c5025e
chore: update github workflow checkput plugin references (#19676) 2024-09-29 21:23:02 +08:00
Louis Sullivan
e370b8130a
Updated pyyaml and httptools in requirements template (#19666)
Co-authored-by: Louis Sullivan <Louis.Sullivan1@ibm.com>
2024-09-24 23:35:15 +08:00
William Cheng
b42027da5d update aspnetcore samples 2024-09-23 02:00:54 +08:00
Richard Whitehouse
fb36272358
[Rust Server] Handle arrays in forms (#19625)
* [Rust Server] Handle arrays in forms correctly

* [Rust Server] Add tests

* Update samples
2024-09-23 00:20:48 +08:00
Richard Whitehouse
8821cf095e
[Core/Rust Server] Check references in additionalProperties correctly when checking freeForm status (#19605)
* Check references in additionalProperties correctly

Handle references in additionalProperties correctly when determining free-form status

* Update samples
2024-09-23 00:19:27 +08:00
Liri S
b4edca5ad4
Use multiline comments for examples in csharp generator (#19079)
* multi

* gen
2024-09-22 23:27:47 +08:00
David Riddervold Marconis
eebecc8646
[aspnetcore] Fix issue #19592 regarding swagger xml comments (#19593) 2024-09-19 13:10:14 +08:00
William Cheng
3240c5baf0
update org.springdoc:springdoc-openapi-webmvc-api, ui to 2.6.0 (#19620)
* update springdoc-openapi-starter to 2.6.0

* pre-populate info if its not defined

* update kotlins spring dependencies to newer version
2024-09-19 12:37:56 +08:00
Richard Whitehouse
d03c90cb97
[Rust Server] Handle additional properties being nullable (#19594)
With:
```
    sampleObject:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/SampleData'
      minProperties: 1
      description: Map of Charging data policy decisions.
```

and
```
    SampleData:
      type: object
...
      nullable: true
```

We currently generate: HashMap<String, SampleData>, which doesn't allow
null charging data entries. This MR changes this to be
`HashMap<String, swagger::Nullable<SampleData>>`, which thus will allow null data entries.

We do this by moving null-handling to the Java code - primarily `getTypeDeclaration()`.

Note, to some extent this is wrong. In this MR (and previously) we are treating
`nullable: true` as an extrinsic property (like required), whereas it should be an
intrinsic property (and thus `HashMap<String, SampleData>` is correct, but `SampleData`
absorbs the nullability.

This would be possible with this code:

```
enum ChargingData = {
   Null,
   Present {
       ...
   }
}
```

Which would remove the usage of https://docs.rs/swagger/2.0.2/swagger/nullable_format/enum.Nullable.html.

I haven't resolved this - and have instead done a more targeted fix.

This, along with some other crude code, creates a scenario where we need to
unpick whether something is null. I've left that, though flagged a TODO to tidy it up at some point.
2024-09-18 15:25:06 +08:00
Richard Whitehouse
f07f8bc997
[Rust Server] Add derive of Hash to enums (#19603)
* [Rust Server] Add derive of Hash to enums

* Update samples
2024-09-18 15:23:27 +08:00
Richard Whitehouse
cf5d17bbfe
[Rust Server] Convert Rust comment to Mustache (#19595)
* [Rust Server] Convert Rust comment to Mustache

The comment about auth types supported by the generator shouldn't be
included in the generated code as it's confusing when the API doesn't
support the same auth types.

As such, we convert it from a Rust comment to a Mustache comment

* Update samples
2024-09-18 15:22:51 +08:00
Beppe Catanese
243f501aef
[GO] Go Server: preserve order of the routes as defined in the OpenAPI file (#19550)
* Add skipSortingOperations configuration option

* Skip sorting operations for go-server

* Add test verifyOrder

* Regenerate samples
2024-09-16 16:52:01 +08:00
Beppe Catanese
2f179fe41d
[Go] Verify content of Go server generated files (samples) (#19504)
* Add Python tests to verify generates Go files

* Run Python tests during CI

* Remove Python tests

* Add Go tests

* Update workflow to run Go tests
2024-09-16 16:48:30 +08:00
Nelson Vides
d02aae7469
Erlang Server – cowboy return types improvements (#19561)
* Declare the correct types for cowboy rest requests

* Adding myself to the erlang team
2024-09-12 16:59:06 +08:00
Evgeny Shichenko
0026e15030
fix kotlin spring boot configuration conflict (#19515) 2024-09-09 11:03:18 +08:00
Nelson Vides
596d446f54
Erlang server overhaul (#19465)
* Upgrade erlang-server code generation and fix is_authorized crashes

* Introduce structured logging

* Improve general formatting

* Update generated files

* Enable erlang server on CI

* Add echo-server testing to CI

* Require OTP27 explicitly in the generated rebar.config file

* Rework handler and API

With this work, json validation becomes optional, fully implemented in
the `_api` module as it was before, but without being forcibly called by
the `_handler`. It is instead left as optional for the user to take
advantage of the exposed callbacks. Jesse also chooses draft-06 as a
default, but these can be chosen manually by the user too, as long as
jesse implements them.

`_handler` also becomes lighter, it now handles all mime types
transparently by forwarding to a user-given module that must implement
`accept_callback/4` and `provide_callback/4` as described in the
`_logic_handler` callbacks. These will simply be the return values of
cowboy_rest's `content_types_accepted` and `content_types_provided`
respectively, and should simply comply with their defined APIs. They
only get two parameters extending the behaviour, so that the user-given
callback can pattern-match on them: the path prefix of the logic
handler, and the operationID of the call.

* Fix return types for provide_callbacks

* Upgrade jesse to incur no dependencies

The less dependencies the built code requires the better.

* Fix dialyzer errors in the generated code

* Apply stronger dialyzer checks
2024-09-07 16:45:42 +08:00
Kresten P. Vester
a98f45b4ac
[Java][Spring]Update dependencies to remove vulnerability in org.springframework:spring-webmvc (#19533)
* Update dependencies to remove vulnerability in org.springframework:spring-webmvc

* Updated samples
2024-09-07 16:26:42 +08:00
Rugal Bernstein
f54b0e25a4
Remove appendRequestToHandler (#19500) 2024-09-04 16:03:31 +08:00
William Cheng
c733bb69a2
[typescript-angular] fix: when model property name is sanitized, use instead original property name within quotes in mustache template (#19508)
* fix: typescript-angular -> when model property name is sanitized, use instead original property name within quotes in mustache template

* fix: updated samples

* chore: added comment for hasSanitizedName

* add original tag, add dummy model for test

* update samples

---------

Co-authored-by: Davide Diaconu <davidediak@gmail.com>
2024-09-02 17:15:58 +08:00
Beppe Catanese
4ed8c70a92
Remove unused go-server-required (#19505) 2024-09-02 15:36:42 +08:00
Richard Whitehouse
2b40a2c058
[Rust Server] Add auto-generated CLI Client (#19392)
* [Rust Server] Add auto-generated CLI tool

* [Rust Server] Test multiple path parameters

* [Rust Server] Test boolean parameters and apostrophes

* [Rust Server] Test operation with two boolean parameters with same first letter

* [Rust Server] Test apostrophes in operation summary

* Update samples

* [Rust Server] Fix build errors with OpenSSL

* Update samples

* Update samples
2024-08-24 23:57:03 +08:00
Richard Whitehouse
eda4547f15
[Rust Server] Fix up model generation (#19363)
* [Rust Server] Fix up model generation

- Correctly generate anyOf/oneOf models
- Fix up ToString / FromStr support
- Disable PartialOrd generation for anyOf/oneOf models
- Generate models for inline enums
- Support enums in headers, and vectors of models in headers

* [Rust Server] Add test for anyOf with additional properties

* Update samples

* [Rust Server] Tidy up logging
2024-08-21 15:14:52 +08:00
William Cheng
91da2fd240
Prepare 7.9.0 snapshot (#19386)
* Revert "v7.8.0 release (#19385)"

This reverts commit 6bdc452f92d49dcac7ac21dfe8751c8cc4267b98.

* update samples for v7.9.0-snapshot
2024-08-19 16:14:51 +08:00
Richard Whitehouse
df2b4210c9
[Rust Server] Sort operations so that the ones with fewest params come first (#19368)
* [Rust Server] Sort operations so that the ones with fewest params come first

This resolves things correctly per
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#pathsObject
- "When matching URLs, concrete (non-templated) paths would be matched
before their templated counterparts."

* Update samples

* [Rust Server] Fix tabs vs spaces

---------

Co-authored-by: Rob Day <Robert.Day@metaswitch.com>
2024-08-18 18:01:19 +08:00
Richard Whitehouse
0a5c99739a
[Rust Server] Allow configuration of multipart/form attachment size limit (#19371)
* [Rust Server] Allow configuration of multipart/form attachment size limit

multipart 0.14+ imposes a 8MB size limit on multipart/form bodies.

This allows that limit to be configured. The default is left as is.

This also improves error messages produced when handling multipart/form bodies.

* Update samples
2024-08-17 16:02:20 +08:00
Richard Whitehouse
172fafe674
[Rust Server] Fix server-writing docs for rust-server (#19367)
* Fix server-writing docs for rust-server

Fix broken link in generated README for rust-server.

* Update samples

---------

Co-authored-by: Keith Wansbrough <Keith.Wansbrough@metaswitch.com>
2024-08-17 15:33:58 +08:00
Richard Whitehouse
fbe6c11903
[Rust] Ensure all features build as part of CI / Upgrade to Frunk 0.4 (#19364)
* [Rust] [CI] Build all features as part of CI

* [Rust Server] Update to frunk 0.4

* Update samples
2024-08-17 14:17:36 +08:00
Tim Quinn
cd02426648
Suppress Pattern annotation on property of type byte array (#19346)
* Suppress Pattern annotation on property of type byte array

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>

* Straggler files from generated samples

* Add new format test to workflows

---------

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>
2024-08-15 17:09:44 +08:00
Richard Whitehouse
024bbb7784
[Rust Server] Improve RFC 13341 compliance for multipart/related (#19355)
* [Rust Server] Improve RFC 13341 compliance for multipart/related

* Update samples
2024-08-15 17:04:59 +08:00
Richard Whitehouse
be09f8a868
[Rust Server] Use swagger/multipart_related support (#19354)
* [Rust Server] Use swagger/multipart_related support

* Update samples
2024-08-15 17:03:59 +08:00
Richard Whitehouse
daf52229e3
[Rust Server] Refactor Mustache templates for request/response body handling (#19347)
* [Rust Server] Refactor Mustache templates for request/response body handling

* Update samples
2024-08-14 15:25:08 +08:00
Richard Whitehouse
b8001323f6
[Core] Consolidate Operation ID generation (#19339)
* [Core] Consolidate Operation ID generation

* Update samples
2024-08-14 15:12:26 +08:00
Sylvain Joubert
d55525fbc4
[C++][Pistache] Fix 'unused-parameter' warning on Helpers.h file (#19315) 2024-08-14 14:34:11 +08:00
Sylvain Joubert
8af3ff2828
[C++][Pistache] Add error handlers overload taking the response object (#19314)
This allows overriders to have full access to the response object and
more finely control the error handling behavior.
For example, this enables the specification of a proper Content-Type in
case of custom format responses (application/json, ...)
2024-08-14 14:31:55 +08:00
Richard Whitehouse
ad7acc30eb
[Rust/Rust Server] Fix example/test code (#19318)
* [Rust Server] Fix code so examples compile

Zero length arrays don't correctly type infer, so if we have no scopes, we need to not create a empty array

We need an authentication middleware - without it the code doesn't compile.

* Update samples

* [Rust Server] Remove trailing whitespace

* Update samples

* [Rust Server] [CI] Build all targets

* [Rust] Fix reqwest test
2024-08-09 15:54:58 +08:00
Stefan Koppier
aea536027c
[bugfix][kotlin-wiremock] fix problems with range responses (#19309)
* [kotlin] Target correct library in jvm-spring-webclient sample

* [kotlin] Fixed warning in jvm-spring-restclient

* [kotlin-wiremock] fixed issue 7193

* [kotlin-wiremock] fixed wrong implementation of fromResponse

* [kotlin-wiremock] forbidden API

* [kotlin-wiremock] fixed wrong workflow trigger
2024-08-07 18:04:05 +08:00
Tim Quinn
8f1d59fb0a
Support Helidon SE 4 generation (clients and servers) (#19150)
* Save work-in-progress

* Incoming param handling generating well exc. for file upload

* Revise generated test for v3 vs v4 differences

* Leave details of multi-part handling to the user for now

* change default version to use the highest version known

* SE client changes for Helidon 4

* A few fixes; add new v4 SE samples

* Fix v3/v4 routing prep

* Improve version handling if web site is inaccessible; add test

* Reworking parameter conversion and required and validation handling

* Add generation of a return value record per response for each operation

* Improvements to the result record generation

* More changes

* Remove change in whitespace in v3 output

* More progress on parameter handling

* WIP - refactor parameter-returning methods to inner class along with return records

* Reorg of op helpers

* Use no-op for handling map in path, query, header, cookie - need to revise later

* Binary form param handling

* Clean-up and consistency check bt useAbstractClass and not

* Improve result builders

* Add new samples files

* Fix a few issues

* Update samples after rebase; add build steps for v3 and v4 uac github actions

* Remove v3 se useAbstractClass test - creates some bad code

* Generated doc updates

* Fix missing newline

* Improve Javadoc for generated Result; add convenience Result.send method

* Add bean val. for body param if needed

* Restructure generated records for declared responses; add Generated annotation selectively

* Fix typo

* In sample generation, force a stable generatorVersion value to avoid confusing builds and up-to-date samples checking

* Fix up white space in older generation

* Generate PartsUtils only with useAbstractClass = true

* Adopt some review comments; more to come

* Review comments; notably, switch to using the first path segment to group operations rather than the tags items

* Improve status handling a bit

* Add new generated sample files

* Add missing new samples files

* Quite a few updates, esp. to generated samples

* New config file for sample

* Updates samples

* Add updates to .openapi-generator/FILES contents
2024-08-04 22:06:30 +08:00
Dieter Eickstaedt
484b87f22a
fix: Template contains unconditional ": Serializable" which creates wrong derive clause on data classes which have a parent as well as are serializable. (#19283) 2024-08-01 14:18:46 +01:00
martin-mfg
2958107a6a
[JAVA-CAMEL] revert broken xml change (#19259)
* revert problematic java-camel XML change

* generate samples
2024-07-29 16:32:33 +08:00
Peter Storch
37afe57f0f
[Kotlin][Spring] fix #19244 integer enum (#19248)
* [Kotlin][Spring] fix #19244 integer enum

* fix embedded array enum
2024-07-26 16:02:34 +01:00
Peter Storch
c93ec54a16
[Kotlin][Spring] fix build.gradle.kts and pom.xml for SpringBoot 2.x (#19246) 2024-07-26 14:06:26 +01:00
Venkatesh Dayananda
3c880719e1
[julia] Add support for style, explode in query params (#19238)
* set style and explode

* update client

* fix

* set the newer version
2024-07-26 17:01:14 +08:00
Peter Storch
0e70d1f068
[Kotlin][Spring] use flag delegatePattern together with skipDefaultInterface (#19212)
* fix #19211 kotlin-spring flag delegatePattern together with skipDefaultInterface generates broken code

* add kotlin-springboot-delegate-nodefaults to the workflow

* fix Platform declaration clash

* move kotlin-springboot-delegate-nodefaults to the kotlin-server-jdk17 file

* fixed empty line
2024-07-23 18:41:14 +08:00
Peter Storch
08e2653935
fix #18555 kotlin-spring generator flag appendRequestToHandler generates broken code when used with flag delegatePattern (#19206) 2024-07-22 08:32:31 +01:00
William Cheng
e40d3228aa
Update CXF to newer version (#19210)
* update cxf to newer version

* better format
2024-07-22 00:30:51 +08:00
Nikita Vakula
e542b06869
[python-fastapi] return 500 if not implemented, added some unittests (#19196)
* [python-fastapi] Added some tests for FastAPI generator

1. Checks the generation of the implementation package.
2. Checks if the endpoints with and without descriptions generate correct
   output.

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>

* [python-fastapi] Raise 500 if there is no implementation

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>

---------

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
2024-07-19 16:14:16 +08:00