5759 Commits

Author SHA1 Message Date
julienlavigne
4cfc32e426
Kotlin-client: Pass OkHttpClient instance to the base class (ApiClient) (#12493)
* Pass client to the base clase

* Regen samples
2022-05-30 10:40:58 +01:00
William Cheng
f0ea10f239
Update R auto-generated doc (#12488)
* update r doc, tests

* add new files
2022-05-29 10:01:44 +08:00
William Cheng
05d49d9107
Add support for allOf in R client generator (#12487)
* add support for all in R client generator

* update samples
2022-05-29 07:22:18 +08:00
Jon Schoning
078232acb5
[haskell-http-client] relax Aeson constraint to allow Aeson 1 (#12486) 2022-05-27 23:22:09 -05:00
Akhil Nair
e823290c8f
[PYTHON] GetItem not working for Client generated allOf model and broken since 5.2.0 (#12239)
* I feel the issue is due to the creation of self._var_name_to_model_instances while doing the deserialization of the data.

Earlier the Python SDK code was using get_var_name_to_model_instances function which was adding var name to model instances that contain it. So <class 'openapi_client.model.stream_options_all_of'> will not part of mapping in self._var_name_to_model_instances for variable name stream_options.

Now with the latest Python SDK code following is the way through which var_name_to_model_instances is created:

    for prop_name in model_args:
        if prop_name not in discarded_args:
            var_name_to_model_instances[prop_name] = [self] + composed_instances
Now as we can see that the var_name_to_model_instances is populated with self and composed_instance which will also contain stream_options_all_of as a composed instance and there will be no check that if stream_options is present in composed_instances or not.

As there is no attribute_mapping found for stream_options in stream_options_all_of, the type for stream_options will be treated as dict for mapping stream_options_all_of as mentioned by @Chekov2k.

So what I suggest is the following code:

    for prop_name in model_args:
        if prop_name not in discarded_args:
           var_name_to_model_instances[prop_name] = [self] + list(
                filter(
                    lambda x: prop_name in x.openapi_types, composed_instances))
This way we can check if the property name is present in that composed instance or not. If it's okay for @spacether I can raise a PR for this.

* [get_item_all_of_bug]
Added samples, test cases to validate all_of schema.

* [getiem_all_of_bug]

Updated docs and samples.

* [getiem_all_of_bug]

Updated test cases, docs and samples.
2022-05-27 21:09:48 -07:00
William Cheng
76eddeb713
php-laravel, enum models, nullable and default values (#12480)
* + support for enum models & separating mustache templates for enums and generics
+ extract property 'type' and 'default value' from a #ref to an enum model
+ support for `PascalCase` naming convention for PHP generators
+ use a default value for known basic types when they are not nullable
+ use 'null' as default value for nullable types when they do not specify the default value
+ use defined constant path as enum default value when found

* + sample output update

* + change model fields to be public and acessible from outside

* + sample output update

Co-authored-by: Mostafa Aghajani <mostafa.aghajani@virta.global>
2022-05-27 11:16:26 +08:00
Cubid
fb1706bd2b
[php-symfony] Allow non mandatory array value (#11618)
Co-authored-by: David CLEMENT <dclement@cfdp.fr>
2022-05-27 00:54:04 +08:00
Taufik Rama
50958e25c0
Fixes #10568 (#12409) 2022-05-27 00:40:33 +08:00
Antonio Petricca
e83f1ed9f4
Graphql nodejs express server lists fixup (#12476)
* Fixed enum values generation fo 'GraphQL NodeJS Express Server' generator.

* Fixed enarrays generation for 'GraphQL NodeJS Express Server' generator.
2022-05-27 00:30:10 +08:00
Robbert van Waveren
b6ef789361
fix #11886 unhandled default enum case (#12344) 2022-05-27 00:27:56 +08:00
cachescrubber
71ea659195
[Java/Spring] Support Spring Boot 3 and Jakarta EE 9 (#12407)
* Migrate annotation.Generated

* Upgrade jakarta.servlet and jakarta.validation

* Prepare pom.xml for spring boot 3

* Introduce spring-boot-3 sample config.

* Create spring-boot-3 sample.

* Introduce useSpringBoot3 cli option.

* Generate Docs

* Add spring milestone repo

* Generate Samples

* Adjust Unit Tests

* Add Spring Boot 3 Support to spring-cloud library

* generate spring cloud 3 sample

* Remove springfox

* Fix typo.

* No longer support SpringFox and Swagger1 with Spring Boot > 3.x

* Generate Docs

* Use Spring Boot 3.0.0-M3

* Generate Samples
2022-05-27 00:07:19 +08:00
William Cheng
c6a4947523
fix ocaml readme installation (#12477) 2022-05-27 00:03:24 +08:00
Antonin Décimo
5cce050260
[OCaml] Code generation fixes (#12395)
* [ocaml] Open Lwt.Infix rather than Lwt

The Lwt module has functions that might shadow parameters, and all the
functions we use from Lwt are in Lwt.Infix too.

    File "src/apis/image_api.ml", line 13, characters 69-72:
    13 |     let uri = Request.maybe_add_query_param uri "all" string_of_bool all in
                                                                              ^^^
    Error: This expression has type 'a t list -> 'a list t
           but an expression was expected of type bool option

* [ocaml] update petstore samples
2022-05-26 23:54:13 +08:00
Tom Bärwinkel
54dca39459
Add authentication for haskell-servant (#12470)
* Add authentication for haskell-servant

* Add BearerToken to HaskellServantCodegen.java
2022-05-26 23:44:13 +08:00
Antonio Petricca
4233d2aa99
Fixed enum values generation fo 'GraphQL NodeJS Express Server' generator. (#12389) 2022-05-26 23:31:03 +08:00
William Cheng
5bd94b8fa0 prepare 6.1.x 2022-05-26 12:58:25 +08:00
William Cheng
36a9cf394d
update samples (#12466) 2022-05-26 12:13:59 +08:00
William Cheng
69f79fb789
Prepare 6.0.0 release (#12463)
* prepare 6.0.0 release

* update samples

* update meta codegen
2022-05-26 10:28:01 +08:00
Johan Sjöblom
770c1cb053
[Kotlin-spring] add springdoc config (#12377)
* Adding Springdoc config to Kotlin-Spring

* Updating relevant samples

* Updating unrelated samples
2022-05-26 09:56:46 +08:00
William Cheng
7b08aa408d
[R] improve code format (#12387)
* better code format for r client

* more code format improvement
2022-05-25 18:02:52 +08:00
William Cheng
621f87b5e6
minor enhancements to php symfony 6 generator (#12455) 2022-05-25 16:12:22 +08:00
Benjamin Häublein
77fa028bb3
[php-symfony] Symfony6 support (#11810)
* support symfony6

* fix issues with StrictJsonDeserialization

* regenerate samples

* add suggestions

* update samples

* support php 7.4 and symfony 5

* allow versions based on semantic versioning

* regenerate sample

* change method of determining result types

* update samples

* describe usage of bundle in symfony app

* better documentation

* fix duplicate auth methods

* do not set namespace for default types

* fix UploadedFile type

* next try fixing auth

* regenerate samples

* fix: auth method shall not be duplicated

* Revert "fix duplicate auth methods"

This reverts commit 0dc418737b1379a30b7f22e7937819ba965c9ddb.

* chore: regenerate samples

* fix tests

* regenerate sample

* more fixes for tests

* update tests

* add kernel shutdown

Co-authored-by: Benjamin Haeublein <benjaminh@testing-vm.lan.benjaminh.de>
Co-authored-by: Renaud de Chivré <renaud@tahitiwebdesign.com>
2022-05-25 15:34:50 +08:00
0xNF
96dd6c5806
[Dart] Fix incorrect generation of additionalProperties:true (#12165) (#12426)
* Update samples

Co-authored-by: 0xNF <0xNF>
2022-05-25 11:58:45 +08:00
Peter Leibiger
111675b89b
[dart][core] Fix reservedWordsMappings (#12436)
* [core] Fix naming of reservedWordsMappings 

* `GeneratorSettings` used a wrong name (missing `s`) which resulted in config loaded from YAMl files not working

* [dart] Respect reservedWordsMappings when checking for reserved words
2022-05-25 11:56:51 +08:00
Kuzma
45cbd5f7a7
[Php] Convert boolean value for query string (Configuration) (#12385)
* convert bool to query string format

* add variable

* update samples

* add test
2022-05-25 10:36:21 +08:00
Oren Samuel
4ec14706df
#12445 - avoid resolving ref schema to the actual schema for enum (#12446)
* #12445 - avoid resolving ref schema to the actual schema for enum

* #12445 - update samples
2022-05-24 23:51:08 +08:00
CodeR
e598d1afe7
OkHttpClient - fix enum properties in requests #12450 (#12452)
Co-authored-by: Grigory Tihonov <grigory.tihonov@lamoda.ru>
2022-05-24 16:22:16 +01:00
CodeR
73b0762f36
OkHttpClient - replacing static client usage with client Injection #12444 (#12448)
Co-authored-by: Grigory Tihonov <grigory.tihonov@lamoda.ru>
2022-05-24 13:51:47 +01:00
William Cheng
de8decc9f5
throw exception when failed to refresh token (#12431) 2022-05-24 14:51:39 +08:00
Justin Black
4d544994fd
[python-experimental] BoolSchema + NoneSchema improvements (#12411)
* Moves is_none is_true is_false methods into base mixins, adds tests

* Improves docstrings
2022-05-23 15:55:49 -07:00
William Cheng
ccd64ce203
update gson to newer version in kotlin templates (#12425) 2022-05-22 14:13:03 +08:00
William Cheng
06688cdfe1
update gson to 2.8.9 in android httpclient (#12423) 2022-05-21 22:02:05 +08:00
William Cheng
8804ba50ed
update android dependencies to newer versions (#12421) 2022-05-21 17:04:42 +08:00
William Cheng
e0bd2440f1
[Java] Update rest-assured dependencies (#12420)
* update rest-assure dependencies in java client

* update rest assured version

* update gradle, sbt build files
2022-05-21 16:18:39 +08:00
chatelao
11462e7fde
Add - Status colors in Wiki, Example per parameter (#12394)
This are small (but visually nice) improvements:
- Add colors: 200 = green, 300 = blue, 400 = red
- Add an example per parameter for better understanding
2022-05-21 14:49:19 +08:00
William Cheng
c270640a36
Better support for inline schemas in parameters (#12369)
* better support for inline schema in parameters

* fix parameter model type

* add new method for model

* minor update

* fix isModelWithProperties

* fix is model check

* null check for properties

* inline parameter enhance with python-experimental fix [WIP] (#12397)

* Uses unaliasSchema rather than ModelUtils.getReferencedSchema

* Fixes python-experimental, delays param schema setting

* Samples regenerated

* Adds parameterModelName setting back in

* Samples regenerated

* removes needToSetSchema

* Sets schema differently depending on if inline model resolver is used

* Adds step for getting ref schema

* Samples regen

* fix test

* bug fix for rust generator

Co-authored-by: Justin Black <spacether@users.noreply.github.com>
2022-05-20 20:25:15 +08:00
cachescrubber
8be490d130
Upgrade Spring Boot to 2.5.14 / 2.7.0 (#12408)
* Upgrade Spring Boot to 2.5.14 / 2.7.0

* Generate Samples
2022-05-20 20:24:13 +08:00
Arvind Krishnakumar
874853e408
Remove javadoc comment for unthrown IOException (#12401) 2022-05-20 17:08:22 +08:00
William Cheng
e24527b4d7
remove errorObjectSubtype from java client genreator (#12405) 2022-05-20 17:06:17 +08:00
Miroslav Oujeský
3f788d3d77
[java][Micronaut] generator fixes (#11803)
* Fix ConfigurableAuthorization package name import to come from configuration

* Fix Micronaut @Consumes and @Produces annotations, allow multiple content types

* Fix security schemes rendering and Micronaut @Authentication pairing with application settings when special characters are present

* Updated samples

* Code review feedback

* Add xml to dependencies and fix tests

Co-authored-by: Andriy Dmytruk <andriy.dmytruk@oracle.com>
2022-05-20 13:24:48 +08:00
Katsuyuki Omuro
c3976a4a4d
Apply style and explode values from encoding for form-encoded request body parameters (#12162) 2022-05-19 23:13:54 +08:00
Andriy Dmytruk
0ad970f4cf
[Micronaut] Improvements for Server and Client (#12297)
* Add the applicationName parameter to support generation of multiple clients

* Change indentation in application.yml to double-space

* Update swagger annotations version, and option to choose not to generate the annotations

* Generate operations only in the first defined tag class for micronaut server

* Improve micronaut client options by setting the correct default values in the JavaMicronautAbstractCodegen constructor

* Fix visitor pattern having abstract method in non-abstract class. Update samples

* Update server sample FILES

* Minor refactor

* Fix for context path
2022-05-19 02:03:45 +08:00
William Cheng
3597621fbc
[R] Use snake_case in method parameter names (#12390)
* use snake_case in method parameter names

* update doc
2022-05-19 01:23:27 +08:00
Mikko Maunu
3a102e0e5b
Added linefeed between @Generated-annotation and start of class declaration. fixes #10746 (#12181) 2022-05-18 15:45:34 +08:00
Auke Schrijnen
a57509695a
[java-micronaut] Return HTTP 501 in default implementation (#12365)
The default controller implementation returns an empty response. This
might result in unexpected behavior when an operation isn't implemented,
as a consumer of the API there is no way to notice the difference
between an unimplemented method and an actual empty response.

By changing the default behavior to return HTTP 501 Not Implemented the
user will be made aware of unimplemented methods. The former default
behavior, returning an empty response by default, can be activated with
a configuration option.
2022-05-18 14:17:22 +08:00
Nick Dunne
d38cb1b37a
[java][spring] added springdoc support for service metadata and security (#12346)
* added springdoc config file to codegen

* added mustache template for springdoc config

* changed type to all caps so it can be used in the template

* added security scheme details
caveat: didn't add oauth2 flows

* removed url not supported by codegensecurity

* Fixed default doc provider in help message

* refactored config file generation test
and added springdoc test

* removed default codegen modification
implemented through booleans in template instead

* added new/updated generator files

* fixed escaping of description

* fixed appDescription in template
removed if and fixed escaping

* updated generated files again

* updated to springdoc in generator docs
2022-05-18 11:20:54 +08:00
William Cheng
35dc6451e4
update .RBuildIgnore (#12383) 2022-05-17 16:07:26 +08:00
William Cheng
1b7b4ede44
[R] fix warnings in DESCRIPTION (#12380)
* fix warnings in description

* fix maintainer

* update test with jsonlite method instead
2022-05-17 13:25:16 +08:00
William Cheng
13496aad5b
[R] Add import in the namespace file (#12372)
* add import in the namespace file

* add import r6
2022-05-17 10:52:39 +08:00
William Cheng
040482e977
add support to download response as file (#12373) 2022-05-17 10:52:09 +08:00