9299 Commits

Author SHA1 Message Date
Alexey Makhrov
f773ac7bfe
[typescript-angular] Support body for DELETE requests (#13457)
* [typescript-angular] Update api template to use HttpClient#request instead of its http-method-specific wrappers

* update expected output for integration tests

* regenerate samples
2022-09-19 08:46:22 +02:00
Luka Dschaak
c4a3866e75
[PHP-Symfony] Encurage Symfony 5 bundle directory structure best practices (#13014)
* use .yaml instead of .yml

This is recommended by Symfony standards

* save Bundle files also to src path

* add test for generate ping

* add package imports

* fix expected file names

* why is Api/ApiServer.php missing

* output filenames

* use getAbsolutePath for debug purpose

* do not use punctuation as current directory

* refactor: remove todos

* use also .yaml in test to fix it

* add test for setting a different source directory

* use correct const for setting source dir property in tests

* import the AbstractPhpCodegen in test class

* put also Resources to source path

* save docs not to Resources

* update samples and improve src path in autoload.php and composer.json

* update moved samples
2022-09-18 15:16:27 +08:00
Justin Black
43375b9392
Upgrades swagger parser to 2.1.1, allows ingestion of 3.1.0 specs (#13133)
* Upgrades swagger-parser

* Removes additional property and halting of spec processing

* Updates tests

* Docs updated
2022-09-17 08:33:47 -07:00
ehealthexperts-rk
62d29c3be3
[JAVA] fix ClassCastException validating an optional JsonArray which is a JsonNullable (#13448) 2022-09-17 22:37:09 +08:00
William Cheng
517816d72b
[R] Add array support to path parameters (#13450)
* add array support to path parameters (r client)

* update samples
2022-09-17 22:35:00 +08:00
Bruno Coelho
b9d71581dd
[kotlin][client] fix file upload with okhttp (#13435)
* [kotlin][client] fix file upload with okhttp

* [kotlin][client] fix file upload with okhttp

* [kotlin][client] update sample projects

* [kotlin][client] fix file upload with okhttp3

* [kotlin][client] update sample projects
2022-09-17 22:08:07 +08:00
William Cheng
863dbc7c3e
r better doc (#13447) 2022-09-17 14:59:02 +08:00
Justin Black
7e87b5d109
Adds contains (#13449)
* Adds contains getter and setter

* Updates codegenProperty

* Updates codegenModel

* Updates codegenparameter

* Updates codegenResponse

* Samples regenerated
2022-09-16 13:36:17 -07:00
William Cheng
943d8bfb8f
Add set support to model properties in R client (#13443)
* add set support to model properties in r client

* update samples
2022-09-16 23:09:23 +08:00
William Cheng
26ebde4a19
support set in r client parameters (#13430) 2022-09-16 13:38:35 +08:00
Justin Black
03cf55085c
Adds dependentRequired (#13442)
* Updates codegenmodel

* Updates codegenProperty

* Updates codegenParameter

* Updates codegenResponse

* Samples regenerated
2022-09-15 22:12:49 -07:00
Justin Black
048af8eeae
[python-experimental] simplifies type checking (#13437)
* Better control of when to write MetaOapg

* Makes MetaOapg in Schema a type hint rather than assignmnet

* Samples regenerated

* Adds tuple types

* Removes types info

* Adds _types

* Samples regenerated

* Adds missing mixins, samples regenerated

* SchemaTypeChecker removed

* Samples regnerated
2022-09-15 17:17:39 -07:00
Justin Black
3177277b52
[python-experimental] adds more base class mixins, preparation for v3.1.0 type arrays (#13436)
* Removes unnecesary typing.Unions

* Adds qty 3 mixin

* Adds qty4 mixin

* Adds mixins for 3-5 type combinations

* Regenerates samples
2022-09-15 11:34:44 -07:00
James Gilliland
abe8c74a3a
Fix php generators treating double as a native type (#13421)
* Fix php generators treating double as a native type

Fixes #13335

* Remove double handling in enum

* Add missed double type removal
2022-09-15 17:16:19 +08:00
Oleh Kurpiak
0c6a951615
[Spring] Bean validation for headers (#13414) 2022-09-14 23:07:08 +08:00
João Neto
7beebe693a
Fix applying optional query parameters (#13419)
* add query params

* update samples
2022-09-14 22:39:34 +08:00
William Cheng
37fb856775
add validation for query enum parameters in r client (#13415) 2022-09-14 14:37:07 +08:00
Julian Kalinowski
7ff47dc0bf
[swift5]: support arrays in multipart/form-data (#13383)
* [swift5]: support arrays in multipart/form-data

* update samples
2022-09-13 11:39:03 +01:00
Joe Heyming ¯\_(ツ)_/¯
072740754b
fix(typescript-fetch): Handle cors errors. (#12960)
* fix(typescript-fetch): Handle cors errors.

If there is a communication error,
e.g. an OPTIONS request returns 404 not found,
then the whole request is cancelled and there is no
response object (it is undefined).

I observed the following error:
TypeError: Cannot read properties of undefined (reading 'status')
Basically response was undefined.

In order to circumvent this issue, we do a check
to make sure response is "truthy", which works
for objects.

With these code changes, it will throw a ResponseError,
which is what you would expect instead of a TypeError.

* regenerate typescript-fetch stuff

* retry code generation

Co-authored-by: Joe Heyming <jheyming@Roblox.com>
2022-09-13 09:03:48 +02:00
Elton H.Y. Chou
8e66294bfe
[python-experimental] Enhance octet-stream deserialize (#13402)
* [python-experimental] Enhance octet-stream deserialization

When the headers didn't provide the filename, use the url of response to
extract filename.

* [python-experimental] Remove todo comment.

* [python-experimental] Fix test code.

* Update samples

* [python-experimental] Refined the method and the test

+ Early return when the url is empty or `None`.
+ Removed unused f-string prefix.

* [python-experimental] Comapre url is None explicitly.

* Update samples.
2022-09-12 12:04:14 -07:00
Austin Ziegler
194d421d83
Further Elixir Client Improvements (#12775)
* Further Elixir Client Improvements

Resolves #12731 and is the completion of the work that I started with
#12751.

The changes here are extensive and likely resolve an issue that I have
seen with the Ory SDK (ory/sdk#194). I have also been unable to run the
integration suite for Elixir as I am (trying) to run everything in
Docker (`./run-in-docker.sh`) as I *do not* have a suitable Java
development environment set up, and do not do enough Java work to really
justify it.

- Updated the README for Elixir projects. Aside from some improved
  readability of the template by use of link references instead of
  inline links, I have also fixed the examples:

  - The `deps` example should have been putting a version constraint
    related to `appVersion`.

  - The `config` example should have been using `packageName` instead of
    `appName`. This particular issue repeats.

- In all Elixir files:

  - Changed the function `@docs` formatting:

    - changed the ehading level for `Parameters` and `Returns` to h3
      (`###` instead of `##`). This will make somewhat better looking
      documentation that does not over-emphasize these details (which
      are *not* documented in a normal Elixir way, but this is somewhat
      to be expected with a code generator.) It may be desirable, after
      testing, to change this to `h4` instead of `h3`.

    - Put parameter names and most return types in in-line code blocks
      (`` `hello` ``).

    - Put return types, when there are multiple types, in a Markdown
      list.

  - Fixed a lot of the spacing. Most files will be *closer* to Elixir
    standard formatting than they were. Because of the limitations of
    Mustache, it is still recommended that people who generate Elixir
    clients run `mix format` at least once on their codebase.

- `api.mustache`:

  - Removed an awkward function pipeline call. If we specified at least
    Elixir 1.12 (something that I do not recommend as we have recently
    jumped from requiring Elixir 1.6 to Elixir 1.10), there is a better
    way to specify this now with `Kernel.then/2`. In the meantime,
    assigning the constructed request structure to a variable and then
    making a separate pipeline for the request execution and handling
    makes for *much* easier to read generated code.

  - Fixed the extra space issue with `evaluate_response` call tuple
    values; `{{=<% %>=}}` changes the tag types, so this change is
    intentional.

- In `config.exs.mustache`, `runtime.exs.mustache`, `mix.exs.mustache`,
  and `connection.ex.mustache`, use `packageName` instead of `appName`
  for configuration specification. If `packageName` and `appName`
  differed, we would end up with cases like ory/sdk#194.

- `connection.ex.mustache` has been almost entirely rewritten. The
  changes started in order to eliminate a `@doc` compile-time warning,
  but shifted to remove the old way of building Tesla client structs
  with `use Tesla`. It works, but is no longer the recommended way of
  building Tesla clients.

  - The *recommended* way of building a Tesla Client would now be
    `Tesla.client(Connection.middleware(), Connection.adapter())`.

  - Exposed both `Connection.adapter/0` and `Connection.middleware/1`
    for use. `Connection.middleware/1` has special handling for the
    cases where OAuth2 or HTTP Basic Auth are defined in the
    application, but do not currently handle any other auth methods.

- `deserializer.ex.mustache` has mostly been reformatted. There are
  things that I do not like about it (I do not like pipelines with one
  line), and I have expanded one function capture into an anonymous
  function for readability.

- `request_builder.ex.mustache` has been updated with better
  function and parameter descriptions and names. Please note that if
  `request |> method(:delete) |> method(:post)` is supposed to produce
  a `POST` operation, we will need to change from `Map.put_new/3` to
  `Map.put/3`.

  - Reordered `evaluate_response/2` so that it is the function documented,
    and made `decode/2` and `response_mapping/3` private functions. As
    far as I can tell, I have *not* changed the functionality.

* Address issues found in code review

- The example dependency code in the README had dropped the opening
  brace for the tuple. This has been resolved.

- The default formatting of the API pipelines has been adjusted to
  minimize possible changes from `mix format`.

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

Co-authored-by: Michael Ramstein <633688+mrmstn@users.noreply.github.com>

* Update modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache

Co-authored-by: Michael Ramstein <633688+mrmstn@users.noreply.github.com>

* Update modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache

Co-authored-by: Michael Ramstein <633688+mrmstn@users.noreply.github.com>

* Update templates based on review comments

Co-authored-by: Michael Ramstein <633688+mrmstn@users.noreply.github.com>
2022-09-12 19:00:58 +08:00
Justin Black
c59759f20a
Adds IJsonSchemaValidationProperties format getter and setter +uses the format info (#13360)
* Adds format getter and setter

* Updates codegenProperty

* Updates codegenModel

* Updates codegenParameter + Response

* Sets format and removes unused import code in python-experimental

* Samples regenerated

* Samples regenerated

* Adds AnyTypeAndFormat

* Separates format bases out from their str or number bases

* Docs updated

* Updates python-exp, stops setting isDate and uses format instead

* Removes python-experimental isDate usages

* Fixes password usages

* Turns off isDateTime in python-experimental java layer

* Sample regnerated without isDateTime

* Removes isUuid

* Turns off isDecimal, decimal_payload broken

* Removes isDecimal

* Removes isByteArray

* Removes isBinary python-exp usages

* Removes isFloat isDouble setting from python-experimental

* Removes isDouble isFloat usages in sample

* Stops setting isShort and isLong in python-exp java layer

* Removes isShort isLong usages from python-exp and generates sample

* Adds decimal as integer input

* Adds missing bool type

* Adds validations to format mixins, adds test_uuid

* Adds test_date

* Adds test_date_time

* Adds test_number

* Adds test_int32

* Adds test_int64

* Adds test_double

* Adds test_float

* Samples updated

* Fixes javadoc
2022-09-11 09:17:16 -07:00
William Cheng
928070c57a
Prepare 6.1.1 SNAPSHOT version (#13399)
* prepare v6.1.1

* update samples

* update doc
2022-09-11 19:08:23 +08:00
William Cheng
43dbb5ff9c
6.1.0 release (#13398) 2022-09-11 17:16:07 +08:00
Segev Finer
9753086bcb
Fix #13369: kotlin-client with okhttp doesn't escape path parameters with slashes correctly (#13370)
* Fix #13369

* Regenarate samples

* Fix support for okhttp3
2022-09-09 16:31:31 +08:00
kmaginot
0b6604504c
[Java][Feign] convert expirationTimeSeconds to milliseconds (#13361) 2022-09-09 00:00:17 +08:00
William Cheng
f98753aa8b
[R] support explode (true/false) in query array parameters (#13364)
* fix query parameters (explode or not) in r client

* add tests
2022-09-07 12:21:13 +08:00
William Cheng
a91201d4ed update ts samples 2022-09-06 23:28:51 +08:00
William Ghelfi
86d6511449
Mark overrides in typescript-fetch and typescript-rxjs (#13322)
* feat(typescript-fetch): mark overrides

fix #12948

* feat(typescript-rxjs): mark overrides

fix #12948
2022-09-06 09:31:43 +02:00
Justin Black
c4d56afcae
[python-experimental] adds test verifying inheriting from multiple AnyType classes (#13358)
* Adds test_additional_properties_validator

* Updates test

* Reverts file
2022-09-05 17:18:51 -07:00
Justin Black
2c5eb54f11
[python-experimental] Improves additionalProperties processing when additionalProperties is unset (#13347)
* Adds NotAnyTypeSchema

* Unit test sample regenerated

* Turns parameter tests back on

* Removes unused from_server_types

* Reverts version files

* Samples regerated with fixed type hints

* Further fixed type hints
2022-09-05 13:17:48 -07:00
Justin Black
f139c090e5
[python-experimental] adds and uses regex patterns for json + filename detection (#13357)
* Unit test sample regenerated

* Reverts version files
2022-09-05 11:03:57 -07:00
Justin Black
cb8d9d5bfe
[python-experimental] adds new json content type (#13356)
* Adds json detection for application/json-patch+json

* Adds jsonPatch route and schemas

* Adds test_json_patch

* Unit test sample updated

* Reverts version files
2022-09-05 09:37:01 -07:00
Ahmed Fwela
2a8ea162d7
[dart-dio] handle polymorphism + discriminator serialization (#12295)
* return structured serializer

* generate samples

* implmented postProcessAllModels to fix assignment of inherited models

* Templates now respect inheritance

* regen dart samples

* only built value support for now

* ignore unused elements

* fixed tests

* new configs to test oneOf

* add some helper vendorextensions for oneOf support

* update templates

* regen samples

* resolve conflicts

* fix missing serializers

* Updated samples and fixed merge conflict

* updated samples

* Follow java conventions

* Follow java conventions

* updated samples

* update sampels 2

* update samples 3 ...

* fix underscores

* fixed missing imports from java code

* update config names

* updated samples

* updated built_value deps

* regen samples

* workaround built_value abstract builders google/built_value.dart#1180

* regen samples

* updated test pubspec

* temp fix rewriteImports for Lists and maps

* Add new samples to CI

* Improve white spaces & formatting

* fix enums not getting assigned correctly

* update samples

* fixed typo

* regen samples

* remove repeating imports

* regen samples

* ignore unused_element warning

* updated tests

* regen samples

Co-authored-by: Peter Leibiger <kuhnroyal@gmail.com>
2022-09-05 16:44:04 +08:00
William Cheng
6c9421684a
escape % in description in r model @field (#13353) 2022-09-05 11:37:24 +08:00
William Cheng
f0d8c3e735
fix query parameter in r client (#13348) 2022-09-05 03:44:22 +08:00
Justin Black
5251a1b739
Adds isBooleanSchemaTrue/False getters and setters (#13341)
* Adds getters and setters for boolean schema true and false

* Updates CodegenModel

* Updates codegenProperty

* Updates codegenparameter and codegenresponse

* Adds comments describing the new properties

* Updates additionalProperty setting for python-experimental

* Sample regenerated

* Docs updated

* Do not write additionalProperties when they are unset

* Updates criteria for when DictSchema subcalsses are created

* Adds NotAnyTypeSchema when a schema is False

* Updates new kwargs signature

* Updates get_item type hints

* Updates sample, readme updated

* Simplifies method calls

* Adds get_item_oapg, removes unset from get_item and getattr

* Sample regenrated

* Fixes tests

* Raises AttributeError if a property is not required and it is dotname accessed

* Fixes one test

* Fixes 3 tests

* Fixes test

* Fixes two more tests

* Fixes test

* Fixes two tests

* Fixes two tests

* Tests fixed

* Unit test sample regerated, fixed unset addprops required type hint issue

* Migration guide updated

* Samples regenerated
2022-09-04 11:40:15 -07:00
William Cheng
c81c103572
[R] Remove obsolete importMapping code, add tests (#13345)
* remove import obsolete code, add tests

* remove man fodler

* update .gitignore
2022-09-05 00:21:52 +08:00
William Cheng
bdf9114d3e update samples 2022-09-05 00:20:18 +08:00
mm's
ef6d383433
Feature/update kotlin dependecies template (#12966)
* update Kotlin & Ktor versions

* update samples

* fix gradle version

* update the ktor client templates and project samples

* update the ktor client templates and project samples

* revert multiplatform upgrade

* update kotlin multiplatform

* upload kotlin Multiplatform samples

* fix gson ktor sample

* update samples

* fix: unused imports

* fix imports of ApiClient

* update kotlin samples
2022-09-04 23:27:24 +08:00
Bill Collins
f6be1d07bc
Do not generate new models for readonly schema references (#13303)
* Add example of nested schema issue

* Add failing test case

* Special case properties with a single allOf and readonly

* Remove rogue file from FILES
2022-09-04 18:01:55 +08:00
Sergey Prytkov
2a007b3465
Fix generation of default array values for kotlin client (#13243)
* Fix generation of default array values for kotlin client

* rerun generation scripts

* replace list of enum with list of string
2022-09-04 17:43:09 +08:00
Michael Edgar
afd357be8a
fix: ensure Resteasy JAX-RS Response object closed (#13333)
Signed-off-by: Michael Edgar <medgar@redhat.com>

Signed-off-by: Michael Edgar <medgar@redhat.com>
2022-09-03 23:40:13 +08:00
William Cheng
2bfbb87862
move print to public method, leave commented code to lock, unlock the class (#13342) 2022-09-03 14:03:03 +08:00
William Cheng
b6576d1173
[R] Update fromJSON to handle additional properties (#13331)
* update fromJSON to handle additional properties

* update RoxygenNote to newer version
2022-09-02 09:46:56 +08:00
Jonas Reichert
fea42b547e
[swift5] distinguish (un-)authenticated requests (#13321)
* add isRequestAuthenticated to request builder

* update samples

* improve samples
2022-09-01 09:18:22 +01:00
Justin Black
62e28a27dd
[python-experimental] improves method names (#13325)
* Replaces all validate methods with public validate ones

* More methods made public with _oapg suffix

* Makes methods private where one can

* Fixes tests

* Fixes typo, maked Disciminable methods public

* Method changed to from_openapi_data_oapg

* Fixes tests for from_openapi_data_oapg

* Tweaks endpoint stub so the endpoint exists for ycharm type hints

* Makes Api methods protected

* Adds binary python type hints, makes get_new_instance_without_conversion_oapg public

* Protects some schema methods

* Protects more schema methods

* Renames as_x, is_x acessors with needed suffix

* Fixes some tests

* Fixes tests, fixes new signature for DateSchema

* Methods removed and made private

* Fixes indentation

* Samples regenerated
2022-09-01 00:34:05 -07:00
William Cheng
d1f44e8a7e
fix http basc auth in R client (#13330) 2022-09-01 14:14:08 +08:00
Justin Black
225204093f
[python-experimental] adds NullableX base class mixins, fixes additionalProperties type hint (#13323)
* Makes additionalProperties type hint include Unset

* Adds 2-class Mixins

* unit test sample regenerated

* Reverts version files
2022-08-31 12:16:53 -07:00
Jonas Reichert
7af9f9c7e7
[swift5] explode query params only if necessary (#13202)
* propagate explode option to mapValuesToQueryItems

* regenerate swift5 samples
2022-08-31 20:50:25 +08:00