Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[phpnextgen] Add ClientBuilder supporting file #1

Open
wants to merge 648 commits into
base: master
Choose a base branch
from

Conversation

ybelenko
Copy link

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh ./bin/configs/*.yaml
    ./bin/utils/export_docs_generators.sh
    
    (For Windows users, please run the script in Git BASH)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.1.0 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 members, so they are more likely to review the pull request.

@SallaDev SallaDev marked this pull request as draft April 21, 2024 21:44
@ybelenko ybelenko marked this pull request as ready for review April 21, 2024 21:45
jase88 and others added 28 commits April 29, 2024 18:07
…ent (OpenAPITools#18457)

* fix(typescript-angular): make sure basePath is defined before assignment

* Update modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>

* chore(typescript-angular): update examples

---------

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
* Update Java version in Github actions

* Generate samples

* [java] Upgrade Gradle wrapper to 8.7

* Generate samples

* [Java] Add resttemplate-jakarta to CI

* Upgrade CI machines to ubuntu-2204:2024.04.4 which use Java 21

* Change CI machines to ubuntu-2204:2024.01.1 which use Java 17

* Change CI machines to ubuntu-2004:2024.01.1

* [ruby] Update Gemfile.locks

* Use gradle wrapper for samples-java-client-jdk17
…nd discriminator (OpenAPITools#18498)

* fix issue 18495

* add tests and update samples

* update samples
…penAPITools#18479)

* fix: ExampleGenerator for composed child schemas and array schemas correctly

* fix: refactor to remove code duplication

* fix: fixes test assertion encoding

* fix: adds doc to new method
…Tools#18476)

* feat: change template to use useSingleRequestParameter

* chore: add useSingleRequestParameter option

* chore: generate-samples, docs and fix spacing in template

* chore: remove random white space
…18539)

* [swift] support content type application json variants

* [swift] support content type application json variants
This allows users to use APIs that require booleans in query params not to be cast to int, e.g. `&foo=true`. Currently, `true` is cast to `1` so it's passed as `&foo=1`. That might not be supported by the target API.

The fix contains copy-pasted function from guzzlehttp/psr7 `Query::build()` with minor tweak.
…OpenAPITools#18538)

* allArgConstructor for java

* Remove leftover from builder pattern branch

* Rename generateConstructorWithAllArgs and use x- in vendorExtensions

* Test issue OpenAPITools#18340

* Add evidences for allVars issue (OpenAPITools#18340)

* remove eol

* update doc

---------

Co-authored-by: jpfinne <jeanpaul@finne.be>
* fix imports with go generation

* Wrong copy over

* Missing new line

* tab vs space

* Fix new line between router and std go libs

* Add both use case, add samples to CI validation

* Update samples
)

Currently when a parsing rule of a field is not respected (eg: min/max
value, required, ...), the api only returns an  error message without
providing the field name to help the user to fix the request. This commit
add the field name to the error message to help the user of the API.
* Update php.md - marked Multiserver as true

Mulitiserver support was fully implemented 2 years ago, on PR OpenAPITools#12982

* update php feature

* update

---------

Co-authored-by: Thomas Hansen <thomasphansen@users.noreply.github.com>
…s#18522)

* feat (JAVA SPRING RESTTEMPLATE) 17571: initial commit for Spring RestClient

* feat (JAVA SPRING RESTTEMPLATE) 17571: Copied and changed the webclient mustache files

The RestClient API is oriented on the WebClient API so many parts of the templates can be the same

* fix (JAVA SPRING RESTTEMPLATE) 17571: Renaming error & add README template

The README must be changed because the minimal Java Version for this client is 17

* fix (JAVA SPRING RESTTEMPLATE) 17571: Imports, compile errors and cookie setting

* feat (JAVA SPRING RESTTEMPLATE) 17571: Add generated samples

* test (JAVA SPRING RESTTEMPLATE) 17571: Add tests

* feat (JAVA SPRING RESTTEMPLATE) 17571: Update doc

* Add the restcilent to samples-java-client-jdk17.yam

The minimum Java version of the used Spring Version is 17

* fix (JAVA SPRING RESTTEMPLATE) 17571: Workflow paths to petstore samples

* fix (JAVA SPRING RESTTEMPLATE) 17571: Regenerated samples

* feat (JAVA SPRING RESTTEMPLATE) 17571: Generated echo-api sample for RestClient

* fix (JAVA SPRING RESTTEMPLATE) 17571: Missing import

* fix (JAVA SPRING RESTTEMPLATE) 17571: Missing body class exception when null body is set

* test (JAVA SPRING RESTTEMPLATE) 17571: Add echo-api Auth test

* fix (JAVA SPRING RESTTEMPLATE) 17571: Gradlew file permissions

* feat (JAVA SPRING RESTTEMPLATE) 17571: Reggenerate samples after rebase

* test (JAVA SPRING RESTTEMPLATE) 17571: Add echo-api Body gif test

* test (JAVA SPRING RESTTEMPLATE) 17571: Add echo-api octet stream body test

* test (JAVA SPRING RESTTEMPLATE) 17571: Add echo-api multipart form data test

* fix (JAVA SPRING RESTTEMPLATE) 17571: Form as body when body is null

Also regenerated the restclient samples
* [kotlin] Target correct library in jvm-spring-webclient sample

* [kotlin] Fixed warning in jvm-spring-restclient
…s#18561)

* [html2] Fix array parameter rendering.

* [html2] Update html2 sample.
…enAPITools#18284)

* [typescript-fetch] Support fileNaming option (OpenAPITools#18283)

* [typescript-fetch] Support fileNaming option - add tests (OpenAPITools#18283)

* [typescript-fetch] introduce constants
… in form-data when contentType is present (OpenAPITools#18505)

* fix content type for list of objects in form-data

* updated the samples
Using archive.org snapshots in case the URLs change again, like they
apparently have in the past.

Also fixing formal JavaDoc error, which does not allow bare URLs.
…s#18552)

* Add .sdkmanrc for easy Java and Maven version management

https://sdkman.io/

* Bump required Maven version for building to 3.8.8
OpenAPITools#18553)

* [BUG] [C++][Pistache] cpp-pistache-server generating API include undefined "Object.h" (OpenAPITools#2769)

Should handle Object.h, AnyType.h correctly. Set.h also tested.

   - #include Object.h removed and replaced by a typeMapping.put(object, nlohmann::json) like suggested in other issues
   - object had an invalid syntax: ':' instead of '::' in types with namespace
   - extra include of #include nlohmann/json.h removed when there's already #include <nlohmann/json.hpp>
   - nlohmann::json is excluded from model namespace

Tested with custom petstore played, with suggested openapi specs coming from issues OpenAPITools#2769, OpenAPITools#10266, OpenAPITools#14234

   ```bash
   rm -rf samples/server/petstore/cpp-pistache-everything/ && ./bin/generate-samples.sh ./bin/configs/cpp-pistache-server-cpp-pistache-everything.yaml  && cd samples/server/petstore/cpp-pistache-everything/ && mkdir build && cd build && cmake .. && cmake --build . --parallel
   ```

* - Adding to samples/server/petstore cpp-pistache-everything

* - .md and FILES missing
…late (OpenAPITools#18418)

* [typescript-fetch] Restore pre-es2017 compatibility in modelEnum template

Restore pre-es2017 compatibility in modelEnum template by not using Object.values in instanceOf{{classname}} function

* [typescript-fetch] Regenerate samples

* [typescript-fetch] Regenerate samples documentation

* [typescript-fetch] Add curly brackets

* [typescript-fetch] Regenerate samples

* [typescript-fetch] Use typed comparison

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>

* [typescript-fetch] Regenerate samples

---------

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
* [kotlin] Target correct library in jvm-spring-webclient sample

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

* [kotlin-client] Bump Gradle version

* [kotlin-client] enableFeaturePreview no longer needed as it's enabled by default

* [kotlin-client] Bump kotlin, spotless, and reactor versions

* [kotlin-client] Generated code

* [kotlin-client] Missed a generated sample

* [kotlin-client] Bumped gradle and java version in kotlin-client workflows

* [kotlin-client] First attempt to fix jvm-volley

* [kotlin-client] Use standard gradle action instead of custom one

* [kotlin-client] Use original gradlew action but without specific version

* [kotlin-client] Moved sample kotlin-spring-cloud to servers instead of clients

* [kotlin-client] Added previously missing generated file

* [kotlin-client] Corrected sample path
…ng (OpenAPITools#18575)

* refactor: move closure definition to own statement

A clippy lint recommends not using a closure inside of a statement.
The code generation used to produce code that triggered this warning,
which caused the rust-server integration test to fail because clippy is
configured to return lint violations as errors.
For details for the lint see:
https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions

* refactor: Remove unnecessary qualification

A GitHub action test used to fail because of a clippy warning that was
emitted due to not using an imported symbol but qualifying its use.
A failed test can be seen here:
https://github.com/OpenAPITools/openapi-generator/actions/runs/8958257509/job/24603984954?pr=18563
With the relevant error being:

error: unnecessary qualification
  --> output/openapi-v3/src/client/callbacks.rs:88:9
   |
88 |         futures::future::ok(Service::new(

This commit simply removes the qualification.

* test: Update examples and run integration test.

Updated examples by running
`./bin/generate-samples.sh ./bin/configs/rust-server-*`
The integration test with the following command passes:
`mvn integration-test -f samples/server/petstore/rust-server/pom.xml`
ckoegel and others added 28 commits June 19, 2024 17:24
* [Ruby] Add Flag to Allow Ignoring Operation Servers

* update samples

* add tests

* fix tests
…r DateOnly properties (OpenAPITools#18874)

* [csharp] Don't apply json converter attribute for DateOnly (OpenAPITools#18541)

Applying the OpenAPIDateConverter to an DateOnly property fails at runtime with an exception.

* [csharp] Update samples
…penAPITools#18965)

* update api client to register type adapter

* update samples

* remove json array variable name
* avoid setting debug property if not needed

* update samples

* fix compatibility with python 3.7

* always set Configuration.__debug

* update samples

* check `Configuration` behavior when debug parameter is / is not set

* address PR requests
…penAPITools#18983)

New versions of rust clippy catch errors with duplicate allow
directives. This change fixes the duplicate directives in generated rust
code.
* see OpenAPITools#18972

Add support for `str`

* update python samples

---------

Co-authored-by: David Riccitelli <david@wordlift.io>
OpenAPITools#19001)

* [Golang] Move utility functions from client.mustache to utils.mustache

* re-generate Go samples

* re-generate Go samples again

* re-generate samples once more

* update go samples

---------

Co-authored-by: Martin Lakov <martin.lakov@ocado.com>
Co-authored-by: Rodrigo Maciel de Almeida <rodrigo.almeida@wefin.com.br>
…d type []Integer (OpenAPITools#19013)

* [Go] Fix an issue causing int array ref be converted into an invalid type, `[]Integer`

* Add test case: wrapped and referenced integer of an array to Go client samples

* add check for ref to property in go abstract

* Update modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java

Co-authored-by: Zhiwei <zhiwei.liang27@pm.me>

---------

Co-authored-by: Zhiwei Liang <zhi.wei.liang@outlook.com>
Co-authored-by: Zhiwei <zhiwei.liang27@pm.me>
* replace MultiPartFile by Resource

* fix SpringCodegenTest

* new approach: small scoped fix

* move to JDK17 workflow

* update samples

* fix formParams
…8981)

* [Python] Add Flag to Allow Ignoring Operation Servers

* generate samples

* add tests
…racts with its parent class (OpenAPITools#18976)

* [JAVA] Fix for OpenAPITools#18975, ensure static block of parent deser class loads

* Add sample spec with type with anyOf
* add tests for anyof with discriminator

* remove test

* update samples
…ools#19022)

Causes failures like:
Configuration `:debugUnitTestRuntimeClasspath` contains AndroidX dependencies, but the `android.useAndroidX` property is not enabled, which may cause runtime issues.
* [Python] Allow Overriding Accept Header

* generate samples

* add tests
…ng jersey2 or jersey3 (OpenAPITools#19033)

* Add type annotations to raw types for jersey2 and jersey3 templates

* Update samples

* Add type parameters to anyof_model.mustache and oneof_model.mustache

---------

Co-authored-by: Kasper S. Nielsen <kasper.s.nielsen@secata.com>
… and date assert (OpenAPITools#19008)

* [PHP-SYMFONY] Debug for Symfony 7 support & debug enum ref & debug array enum ref & debug date assert

* [PHP-SYMFONY] Debug for Symfony 7 support & debug enum ref & debug array enum ref & debug date assert

* [PHP-SYMFONY] Debug for Symfony 7 support & debug enum ref & debug array enum ref & debug date assert
…meter (OpenAPITools#18967)

* fix issue 18959

* fix issue 18224

* fix issue 18224

* fix spaces

---------

Co-authored-by: Rodrigo Maciel de Almeida <rodrigo.almeida@wefin.com.br>
@ybelenko ybelenko marked this pull request as draft June 30, 2024 14:35
@ybelenko ybelenko marked this pull request as ready for review June 30, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment