10946 Commits

Author SHA1 Message Date
William Cheng
6b9f6bd2b1 update java samples 2024-11-18 18:47:40 +08:00
Christian Beikov
4185782ddc
[#20125] Remove unnecessary model package import to avoid ambiguous class references (#20124)
* Remove unnecessary model package import to avoid ambiguous class references

* Regenerate JSON files
2024-11-18 17:43:14 +08:00
jasonjyu
51a0bd00b7
Replaced deprecated 'summary' attribute with recommended 'caption' element (#19961) 2024-11-18 17:34:55 +08:00
William Cheng
1a58d31a81 update gdscript samples, docs 2024-11-17 10:55:57 +08:00
Antoine Goutenoir
959cf1c3c9
[GdScript] Templates for GdScript (Godot 4) (#19267)
* feat(gdscript): sketch implementation of gdscript target language

This does not really work yet, but it's a start.
Results are not denormalized, no support for enums nor datetimes,
and thousands of other features are missing.

I still don't know how we are going to denormalize JSON+LD
without writing a whole GDScript lib for it…

* feat: add an exhaustive list of keywords reserved in GDScript

I've also provided the small python script I used to generate the list.

* refacto(gdscript): start using partials in templates

Whilst I'm racking my brains trying to figure out integration testing…

* test(gdscript): prepare a demo and integration testing

* fix(gdscript): do not use subclasses, use plain POGO

(plain ol' godot object)

One: I don't know how they work under-the-hood.
Two: I'm very confused over-the-hood.
Tri: We do not need them.

* refacto(gdscript): move demo files to their own directory

I know I'm making a lot of commits for not much,
but now I'm opening the sample files with Godot as well,
and doing unholy things with filesystems,
so I'm not taking any chances.

It's all going to be squashed anyway.  :)

* fix(gdscript): sample as a Godot project

It works !  I can now write integration tests in GDScript.
The real work starts now.

/spend 25h

* feat(gdscript): serialize and send body params

The test suite is now past its first hurdle, the 415 HTTP status code,
and went straight into an unexpected error 500.

I suspect the server does not like me trying to set the pet id at 0,
because that's what we're trying to do right now.

Godot is crashing a lot, mostly because I don't know how to make Callable.NOOP
and my current solution hints at optional on_success and on_failure,
yet if we omit them the engine will ragequit.

* feat(gdscript): check request body for required yet missing properties

Now we'll get a nice error when we forget to set a required property.

The demo is now able to:
- connect
- create a user
- login as that user
- create a pet

* feat(gdscript): namespace core classes as well with apiPrefixName

This makes our usage of `class_name` a little more acceptable.

* feat(gdscript): support prefixes and suffixes for class names

This will crutch namespacing well enough for most uses.

* feat(gdscript): handle enums, naively

* feat(gdscript): support basic API endpoint param constraints

- minLength
- maxLength
- minItems
- maxItems
- minimum
- maximum
- pattern (no flags)

* feat(gdscript): handle header params and header customization

We also support serializing to application/x-www-form-urlencoded now.

Next up: DateTimes !

* feat(gdscript): handle Date and DateTime like Strings

There's no timezone support in Godot for DateTimes.

* feat(gdscript): support plain text responses

* feat(gdscript): support collections of models

Those are Arrays, not custom collection objects.

* feat(gdscript): configure default host from OAS

* feat(gdscript): some documentation and better config

We don't need no factories nor singletons ; config is enough.

* docs(gdscript): document usage a little

* feat(gdscript): add more reserved words, skip jsonld models and configure features

We can now generate a client for an OAS server running ApiPlatform (PHP).

* feat(gdscript): improve logging with a configurable log level

* feat(gdscript): add support for Basic Bearer and Header ApiKey

(but I can't find the `description` template handler)

* fix(gdscript)

Too late to amend >.<

* fix(gdscript)

dangsarnit

* chore(gdscript): clean up a sprint artifact

* fix: don't forget the HTTP error code when relevant

* feat: use Resource as base class for models

* fix. Default string values now with "quotes"

* temporary remove settings as godot api have changed

* kick ci

* docs: review gdscript java class

* feat: support for TLS, some refacto, some review

There's still a lot of holes, TODOs and FIXMEs.

* feat: experimental support of Request inline objects

The inline response objects are still not supported.

* feat(gdscript): support inline request and response objects

* chore(gdscript): review the templates

* fix(gdscript): unexpected nulls in default values

{{#if defaultValue}} evaluates to true for null if we call super here.

* refacto(gdscript): replace "bee" prefix by "bzz", use a constructor

Now we pass the config and the client via the constructor.
This reduces the area of the public surface a bit, for the better I think.
This commit also cleans up the class name shenanigans.

* fix(gdscript): add missing file

* test(gdscript): refactor the test project to use the generated lib as addon

Since there is no singleton in the generated client, the addon need not be enabled in the project configuration to be usable.

The --headless mode is broken for now, as things changed in Godot 4 since the beta.

* docs(gdscript): document petstore server ADR

* test(gdscript): add GUT and an integration test

We used the latest stable GUT, but a feature we're going to need was merged today, so we'll need to update it either to master or to the next release at some point.

* refacto(gdscript, breaking): use an ApiResponse object in success callbacks

/spent 6d since the beginning

* test(gdscript): update integration tests

/spend 2h

* docs(gdscript): explain the new ApiResponse

Also moving core templates to their own subdir, for clarity.

/spend 10m

* chore(gdscript): review, document, clean up

/spend 2h

* test(gdscript): test the delete operation as well

/spend 7m

* feat(gdscript): update GUT and exit with appropriate code

/spend 2h

* docs(gdscript): add Gdscript's PI

Hire me while I'm available !  :D
I'd rather code than make a CV.

* feat(gdscript): support reserved keywords

Also adding some more assertions,
and using our own OAS file now.

/spend 3h

* refacto(gdscript): use "base" instead of "bee"

/spend 1h

* feat(gdscript): improve descriptions

/spend 1h

* fix(gdscript): await before polling

Contributed by @jchu231

* docs(gdscript): review the template files

* docs(gdscript): review and generate docs

---------

Co-authored-by: Bagrat <b.saatsazov@gmail.com>
2024-11-17 10:48:19 +08:00
Nelson Vides
86a18bfb62
erlang-server: add jesse to app.up release (#20120)
* erlang-server: add jesse to app.up release

* erlang-server: remove dialyzer errors that might not be related to the program
2024-11-17 10:07:03 +08:00
Tim
66908020e0
[python-pydantic-v1] Fix bug in serialization for SecretStr by applying changes from #18023 (#20102)
* Apply changes of #18023

* Regenerate samples

---------

Co-authored-by: tweber2 <tim.weber@vector.com>
2024-11-16 21:48:11 +08:00
William Cheng
02847e9323
Update minimum supported version of python in docs to 3.8+ (#20118)
* Update minimum supported version of python in docs

* update samples, docs

---------

Co-authored-by: Hugo Posnic <hugo.posnic@protonmail.com>
2024-11-16 18:01:50 +08:00
Alexander Fetisov
b44ba666aa
adding support for @ResponseStatus annotation into spring-http-interface java spring generator (#20071)
* adding support for useResponseEntity into spring-http-interface java spring generator

* adding samples for @StatusResponse into spring-http-interface java spring generator

* additional changes to sample
additional changes to samples jdk17

* adding sample files

* extra adjustments

* fixing generator version

* fixing status code in samples

* some rollback

* some rollback 2
2024-11-16 15:52:11 +08:00
Victoria Casasampere Fernandez
d7a23a9fcf
[Rust-Axum] Fix compilation error when validate is used on Nullable values (#20100)
* Fix compilation error when validate is used on Nullable values

* Update samples

* Switch Nullable Into Option trait implement to From

* Update samples from rebase
2024-11-15 22:03:59 +08:00
Bruno Coelho
293524785e
[swift][client] rename api client to api configuration (#20103)
* [swift][client] rename api client to api configuration

* [swift][client] rename api client to api configuration

* [swift][client] rename api client to api configuration

* [swift][client] rename api client to api configuration

* [swift][client] rename api client to api configuration

* [swift][client] rename api client to api configuration

* Update modules/openapi-generator/src/main/resources/swift6/api.mustache

Co-authored-by: Lennard Sprong <x-sheep@users.noreply.github.com>

* [swift][client] rename api client to api configuration

* Update modules/openapi-generator/src/main/resources/swift6/api.mustache

Co-authored-by: Lennard Sprong <x-sheep@users.noreply.github.com>

* Update modules/openapi-generator/src/main/resources/swift6/api.mustache

Co-authored-by: Lennard Sprong <x-sheep@users.noreply.github.com>

* Update modules/openapi-generator/src/main/resources/swift6/api.mustache

Co-authored-by: Lennard Sprong <x-sheep@users.noreply.github.com>

* Update modules/openapi-generator/src/main/resources/swift6/api.mustache

Co-authored-by: Lennard Sprong <x-sheep@users.noreply.github.com>

* Update modules/openapi-generator/src/main/resources/swift6/api.mustache

Co-authored-by: Lennard Sprong <x-sheep@users.noreply.github.com>

* Update modules/openapi-generator/src/main/resources/swift6/api.mustache

Co-authored-by: Lennard Sprong <x-sheep@users.noreply.github.com>

* [swift][client] rename api client to api configuration

---------

Co-authored-by: Lennard Sprong <x-sheep@users.noreply.github.com>
2024-11-15 09:35:51 +00:00
Jan Škrášek
96adf2f8f5
Fix explicit KSerializer's name & generation when used in container (#20093)
* [kotlin][client] properly reference the same custom serializer name

* [kotlin][client] properly use correct type when enum in container
2024-11-14 14:11:08 +00:00
Jan Škrášek
d442fc9a65
[kotlin][client] do not generate Serializable(forClass) annotation as the serializer is already defined (#20092) 2024-11-14 14:10:07 +00:00
William Cheng
1ceb36f182 update java samples 2024-11-14 15:13:46 +08:00
DielN
216ba30172
[JAVA] Add missing dependencies in templates (#20075)
* Add commons-lang3 dependency for useReflectionEqualsHashCode

* Fix feign-no-nullable config/sample

* Add commons-lang3 dependency to jersey2

* Add & update mutiny dependency for microprofile

* Regenerate samples
2024-11-14 14:08:26 +08:00
Linh Tran Tuan
ee698f1e6d
[Rust-Axum][Breaking Changes] Extracting Claims in Cookie/Header (#20097)
* [Rust-Axum][Breaking Changes] Extracting Claims in Cookie/Header

* Update

* Update
2024-11-14 14:05:30 +08:00
Nelson Vides
a95ea1f519
erlang-server: Extend provided return and make the type available (#20088) 2024-11-12 22:27:37 +08:00
Nelson Vides
20b5059aa5
Erlang server (#20087)
* erlang-server: Extend provided return

* Regenerate erlang-server handlers
2024-11-12 21:26:58 +08:00
William Cheng
85f711236c update scala samples 2024-11-11 18:54:20 +08:00
Aaron Pritzlaff
6792218775
Scala Cask oneOf support (#20051)
* added support for 'oneOf' types represented as unions

also updated libs and an 'errors' field rename to address
name clashes with likely/popular field names

* Created cask-specific petstore example which 
Includes a oneOf and allOf example
2024-11-11 18:46:27 +08:00
0xNF
bfcfc6ff25
[Dart2] Added better double handling to 'mapValueOfType<T>', which previously would fail when deserding doubles (#17808) 2024-11-11 18:33:08 +08:00
William Cheng
6bc8e0bffc
Fix duplicated operationId with new rule in normalizer (#19872)
* fix duplicated opeationId with new rule in normalizer

* update workflow

* update samples

* update samples

* update java samples
2024-11-11 18:12:46 +08:00
DielN
2a17134628
Add equals and hashCode methods to Microprofile (#20011)
* Add equals and hashCode methods to microprofile

* Add missing import

* Update samples

* Add missing dependency for reflection equals
2024-11-10 17:43:19 +08:00
William Cheng
6ff52c7e31
suppress the cast warning in java okhttp-gson client (#20076) 2024-11-10 17:34:40 +08:00
Dennis Ameling
13b11d7706
kotlin-server: Fix required + nullable combination for properties (#20054)
* kotlin-server: Fix required + nullable combination

* Update FILES

* Updated generated code
2024-11-09 22:35:11 +08:00
Julian Vennen
6bd3d53eee
[PHP/Dart/Python] Correctly escape strings in single quotes (Fixes #17582) (#19529)
* [PHP/Dart/Python] Correctly escape strings in single quotes (Fixes #17582)

* Move escapeTextInSingleQuotes method to DefaultCodegen, add docblock
2024-11-09 16:50:12 +08:00
Alec Petersen
bbccd2827f
Replace MaxTimeout usage with Timeout, update Timeout to be a TimeSpan type (#19875) 2024-11-09 14:07:13 +08:00
DaveK-Rocketmakers
d9229c7b9f
fix(csharp): Fixed JsonConverter for discriminators only appearing on base classes (#19972)
* fix(csharp): Fixed JsonConverter for discriminators only appearing on base classes

* chore: Updated .NET samples
2024-11-09 13:55:02 +08:00
Cameron Koegel
5702751e91
[Java] Respect User Supplied Header Params (#20042)
* [Java] Respect User Supplied Header Params

* remove if `dynamicOperations` true
2024-11-09 13:41:30 +08:00
Dennis Ameling
a7a86398d0
[kotlin-server] Bump Kotlin/Gradle versions and improve CI triggers/config (#20061)
* [kotlin-server] Bump Kotlin versions to latest

* Run tests on more samples

* Fix typo in workflow definitions

* Update samples

* Bump Gradle to 7.6.4

* Some further tweaks

* Bump Gradle versions

* Fix Gradle version syntax
2024-11-09 13:39:20 +08:00
Dennis Ameling
7bce639441
[typescript] use supportsES6 in sample testing (#20062) 2024-11-08 14:11:54 +01:00
Jenny G. L.
961c2e44d1
[scala][client]: scala-http4s: minor improvement (enum companion method, remove implicit, error handling) (#19901)
* [scala][http4s][client]: add enum method; remove implicit

* improve error handling

* more enum enhancement

* remove unused

* update samle

* avoid breaking change

---------

Co-authored-by: Jenny Leahy <jennyleahy@JENNYLEAHY.localdomain>
2024-11-08 17:15:32 +08:00
Sylwester Zieliński
3a3688280f
Bump libraries for Kotlin-client. (#20053) 2024-11-08 08:05:28 +00:00
Jules Ivanic
2c38d0de35
[typescript-fetch][Fix] oneOf models are generated without ...ToJSONTyped functions but models referencing still try to import (#20046)
* Fix #19858

* re-generate the samples
2024-11-07 14:33:33 +01:00
William Cheng
28e02fc1a2 update aspnet samples 2024-11-07 20:33:49 +08:00
Julien Tschäppät
7deecdc569
[csharp] Add a server generator for FastEndpoints (#19690)
* Add of a first working generator for FastEndpoints framework

Generator that support the basics of a FastEndpoints project
https://fast-endpoints.com/

* Add respose code documentation support

* Add an option to enable use of problem details

* Clean enum and model

* Add an option to generate record for requests/models

* Update sample

* Add support of nullable types

* Add option to enable authentication

* Add option to generate validators

* Clean readme.md file

* Add option to enable response caching

* update readme template

* Add missing files references

* Update generated sample

* Add link to documentation

* Add generator documentation

* correctly support packageName

supportingFiles additions moved to processOpts()

* improve useAuthentication option handling

Avoid to copy an empty file

* processOpts, move call to parent at the end

* Update generated sample

* Refactor and fix super.processOpts(); call order

* Handle the case of multi-line description

* Rename field to match naming conventions

* Add useApiVersioning option

* Update generated sample

* Add generator documentation

* Fix record when model contains optional properties

* Add configuration files for each option

* Add sample project for each configuration

* Add GitHub Action workflow for sample projects

* Add FastEndpoints BindFrom attribute on path, query and form params

* Update sample generated projects

* Fix validator template

* fix alphabetical order

* Use fully qualified name for FastEndpoints

* Add options to set GUID to be used in sln file

* update sample projects

* Update generators.md

* Fix path in github workflow

* Put readme, gitignore and solution file at the root of generated project

* update sample projects

* Remove the projectGuid option

This Guid need to be constant, it is related to project type

* update sample projects
2024-11-07 20:28:29 +08:00
Linh Tran Tuan
cfef948c11
[Rust-Axum] [Breaking Changes] Prevent Operation response with internal Error (#20047)
* [Rust-Axum] Fix: prevent Operation returns Internal Server Error

* Update
2024-11-07 18:39:51 +08:00
Cameron Koegel
98cd9bd803
[typescript-axios] Respect User Supplied Header Params (#20040) 2024-11-06 18:01:59 +01:00
Jonathan Ballet
57cfff1950
python: stronger typing for the "configuration" module (#20014)
* python: strong typing for the configuration module

* 3.8 compatibility

* fix bearer format

* Specific auth settings
2024-11-06 16:36:47 +08:00
devhl-labs
54920ff106
[csharp][generichost] Better handling of duplicate operation ids (#19913)
* fixed missing output

* bug fix

* add new sample

* build samples again

* delete sample

* move the sample and add to github workflow

* remove model not needed for this test

* handle specs with no models

* better handling of duplicate operation ids

* fixed mistake in resolving conflicts

* build samples again

* revert a change sent in another pr
2024-11-06 16:29:49 +08:00
Aaron Pritzlaff
b51b18e3ca
Scala cask api effects (#19936)
* Scala-cask improvements:

 * fixe for grouped methods which have routes containing dashes.

Previously our OperationGroup work-around would potentially
Create methods like ‘foo-bar’, which isn’t a valid function name

 * Fix to not import some.package.Array[Byte] when binary format is specified

 * Fix for grouped operations which contain duplicate query parameters

 * Fix for binary response fields. This can come up with the following example

        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "format" : "binary",
                  "type" : "string"
                }
              }
            },
            "description" : "data"
          },

 * Fix for enum model classes
Extracted complex logic for ‘asData’ and ‘asModel’ transformations for properties

 * Introduced a generic effect F[_] for services

This was done to support composable services
(Service A calls Service B) by using monadic
Effect types (ones which can flatMap)

 * Fixed unique union types for responses, asModel and asData fixes for non-model types

* scala-cask: regenerated samples

* Fix for reserved-word properties in the API

* Fix for null imports and reserved-word enum types

* Fixes for api methods with backticked params

* Fix for duplicate (by name) grouped params

* small syntax fix

* logging response type

* Regenerated samples

* String.format fix
2024-11-06 16:14:31 +08:00
Linh Tran Tuan
cded99c3fc
[Rust-Axum] Support Authentication (Cookie, API Key In Header) (#20017)
* [Rust-Axum] Support Cookie Authentication & API Key In Header

* Fix

* Fix

* Fix Header Params & Responses
2024-11-06 16:13:00 +08:00
Tanmay Mohapatra
06547b7b82
[julia] improve enum support (#20016)
* [julia] improve enum support

Improved enum support. Added an override for `postProcessModels` method in julia code generator to do enum post processing. Added an override for `toEnumValue` method in julia code generator to generate enum values correctly based on julia types. Updated templates to use `#enumVars` for generating enum values.

* generated samples
2024-11-06 16:04:15 +08:00
Lennard Sprong
bdad11d027
[swift6] Add Sendable conformance to request parameter enums (#20023) 2024-11-04 16:23:09 +00:00
Lennard Sprong
00dbe59994
[swift6] Add Sendable conformance to structs and enums (#20013) 2024-11-04 11:38:46 +00:00
Chirag Jain
67af02ccc8
python-pydantic-v1: Keep trailing commas for enum validation tuples (#19985)
* python-pydantic-v1: Keep trailing commas for tuples when enum has just single member

* Update samples

* Add test for single member enums

* Refactor test name
2024-11-02 15:26:19 +08:00
Kirill Zimnikov
66c7b2f8cc
feat cpp-qt-client: fix cast primitive to string (#20000) 2024-10-31 21:10:07 +08:00
William Cheng
b66b7af5d0
[JS] set option to true by default, update samples (#20003)
* set option to true by default, update samples

* update doc
2024-10-31 15:01:37 +08:00
Alexander Kose
c70b07808e
Add support for a token supplier to OAuth based RestClient clients. (#19944)
Fixes OpenAPITools#19943
2024-10-31 14:13:59 +08:00
Pavel Sveda
acb16410c4
[Kotlin] Introduce support for Kotlin Explicit API Mode for Kotlin-Client generator (resolve #16506) (#19999)
* [Kotlin] Properly document nonPublicApi CLI option

* [Kotlin] Respect parameter name of parent KSerializer to avoid miss-behavior

* [Kotlin] Introduce support for Kotlin Explicit API Mode for Kotlin-Client generator (resolves #16506)
2024-10-30 21:57:47 +00:00