11973 Commits

Author SHA1 Message Date
William Cheng
9cc23dd09d
[JavaScript] add oneOf support (#13561)
* JS add oneOf support

* add validate json method

* add oneOf support to JS client

* update samples

* add todo in anyof

* switch to composed.oneOf

* update oneOf to support primitive types

* update messages

* minor fix, add more tests

* update samples

* fix npe in from model

* fix syntax error in length check

* update samples
2022-10-02 13:34:50 +08:00
Jonas Reichert
00604aff59
[swift5] [alamofire] adds ability to inject custom response serializers (#13542)
* adjust templates to allow injecting ResponseSerializers

* generate samples

* swift < 5.5 compatibility
2022-09-28 17:34:17 +01:00
William Cheng
6a631b4cc0
[R] add discriminator and mappings support (#13529)
* add discriminator property, mapping

* add discriminator, mapping support to R client generator

* add discriminator, mapping support to R client genrator httr library
2022-09-28 00:18:28 +08:00
devhl-labs
4e54b07076
[csharp] Fixed isMap property (#13482)
* fixed data type for maps

* fighting line endings

* fighting line endings

* removed commented code

* reverted unintended line break

* reverted unintended line break

* reverted unintended line break
2022-09-27 11:10:10 +08:00
William Cheng
6b47b14896
update restsharp to the latest stable version (#13525) 2022-09-27 11:05:37 +08:00
Jonas Reichert
22086e4f3c
[swift5] support both date and date-time formats (#13520)
* add withoutTime formatter

* add DateWithoutTime

wip

* fix CI

# Conflicts:
#	samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/DateWithoutTime.swift

* implement flag and adjust tests

* generate samples and docs

* docs

* update samples

* remove samples of legacy python generator

* Revert "remove samples of legacy python generator"

This reverts commit 28da78f99dcaa6cf761367b0a2d2c3fddf4803ec.

* review remarks

* generate samples

* fix

* review remarks

* remove samples

* generate swift 5 samples

* generate csharp examples

* docs

* Revert "generate csharp examples"

This reverts commit d1deb17dbcd04b9b00d9ad4a08ce55bedd960de8.

* Revert "generate swift 5 samples"

This reverts commit 968e859bfe3ce631f174d10f10983ed2f5c09486.

* Revert "remove samples"

This reverts commit a43d21529ba6a9e615671729d970ec7ef9662402.

* manually remove FILES

* regenerate files

* reviewers remarks

* delete all date without times

* update config of alamofireLib to use new attribute and generate samples again

* docs
2022-09-26 17:39:35 +01:00
Austin Ziegler
de745a4c61
Elixir: Improve generated API options docs (#13478)
While working with the Magento 2.4 API definition, there were several
issues found. The easiest to resolve is a documentation naming issue.
(The others will be raised for discussion.)

This is known to be an issue with query parameters, but may not be
limited to *just* query parameters.

In the event that a parameter is a mix of arrays and objects, the
template in the documentation for the API function was expanding out the
parameter name such that `foo[0]` would be turned into
`:foo_left_square_bracket0_right_square_bracket`, but the actual
parameter name was being left as `:foo[0]`, which meant that the
documentation did not reflect the actual parameter.

> Note: there are issues with the way that query parameters are put
> together in this sense, which is going to require substantially more
> work to resolve as well as discussion on how these options should be
> implemented, as what the Magento API requires may not be what is
> expected by a different server, and the nature of the input parameters
> is itself incorrect.
2022-09-26 11:34:44 +02:00
Thomas Hansen
efccc01911
[PHP] BUGFIX: model_generic: fix missing setOpenAPInullablesSetToNull method (#13499)
* [PHP] Bugfix - model_generic.mustache: missing setter for openAPINullabelsSetToNull (which is invoked in the property setters)

* [AUTOGENERATED] update samples

* [PHP] Added test for nullable fields
2022-09-26 17:20:51 +08:00
William Cheng
d46189bb28
Add .net framework 4.8 support (#13504)
* add .net framework 4.8 support

* add dependency, test in appveyor

* update doc
2022-09-26 11:02:39 +08:00
William Cheng
ac7ebf67dd
Prepare 6.2.1 (#13517)
* update to 6.2.1-SNAPSHOT

* update samples

* update doc
2022-09-25 00:10:30 +08:00
William Cheng
24f476a381
prepare 6.2.0 release (#13514)
* set release version to 6.2.0

* update samples

* comment out rust server test in travis
2022-09-24 21:44:42 +08:00
Justin Black
7e73645303
Switches python-experimental in as the primary python client (#13501)
* Changes python to python-prior

* python -> python-prior, python-experimental->python

* Renames sample spec directories

* Samples regnerated

* Regenerates docs

* Fixes test

* Samples regenerated

* Updates renerators list

* Fixes made to python paths in pom.xml

* Fixes node4 sh file paths
2022-09-24 16:19:38 +08:00
Mostafa Aghajani
9d621342e0
[Kotlin] Fix wrong default value is generated for non-integer numbers (#13507)
* ISSUE-13506 fix number value for default values when they are number

* ISSUE-13506 test and sample update
2022-09-23 15:02:49 +01:00
Justin Black
d25cdbb2ce
[python-experimental] removes enum cls factory (#13491)
* Movs enum info, changes cls factory to base class + updates samples

* Fixed docs for enums, they show the allowed bool and None values now
2022-09-22 11:08:09 -07:00
William Cheng
e146afbea1
better enum status validation (#13486) 2022-09-22 10:04:03 +08:00
Justin Black
5f9910dcab
[python-experimental] reduces python version (#13481)
* Removes classmethod property combinations

* Changes python version to 3.8

* Changes python version to 3.7

* Tests fixed

* Samples updated

* Adds getAddSuffixToDuplicateOperationNickname and uses it in python-exp, samples regenerated

* test_paths regenerated

* Fixes bug

* Adds typing_extensions requirement
2022-09-21 18:41:11 -07:00
Naoki Ikeguchi
fa51d8b6b3
[rust-server] Resolve clippy warnings (#13473)
* fix(rust-server): Use ok_or_else instead of ok_or

* fix(rust-server): Remove empty format string

* fix(rust-server): Remove redundant field names in struct initialisation

* fix(rust-server): Remove redundant clones

* fix(rust-server): Derive Eq with PartialEq always

* fix(rust-server): Remove immediately pushes replaced by vec macro

* fix(rust-server): Remove useless conversions

* fix(rust-server): Dismiss clippy::new_without_default

* fix(rust-server): Fix compilation failures

* fix(rust-server): Resolve remaining warnings

* build(rust-server): Add newly generated samples of petstore

* fix(rust-server): Allow clippy::derive_partial_eq_without_eq to avoid float types try to derive Eq

* fix(rust-server): Fix parts to compile samples successfully

* fix(rust-server): Allow clippy::redundant_clone instead of removing redundant map_err

* fix(rust-server): Resolve and dismiss lots of warnings to satisfy clippy on samples

* build(rust-server): Add clippy execution to sample integration test

* build(rust-server): Add .cargo/config to the test root to use -Dwarnings flag in tests

* fix(rust-server): Allow unused_mut to avoid compilation fails in some environments
2022-09-21 22:45:08 +08:00
William Cheng
09d3b8f866
fix optional body parameter in r (#13483) 2022-09-21 11:56:31 +08:00
Justin Black
903f2e2e2e
[python-experimental] improves documentation (#13477)
* Improves docs generation

* Adds inline composed schemas

* Adds missing from property

* Adds notes info

* Fixes spacing

* Updates notes, generates container properties

* Adds anchors to property schema docs

* Adds format info to docs

* Adds items schema documentation

* Adds doc for additionalProperties

* Adds anchors for response types

* Fixes anchors in endpoint

* Fixes api doc link to model doc

* Removes returnType from api docs because it is unused

* Fixes float and double tests
2022-09-20 14:53:58 -07:00
Linus Klöckner
6a7567e7cb
PHP: fix ranged status codes (#13012)
* PHP: fix ranged status codes

* PHP: update samples
2022-09-21 00:21:46 +08:00
Jacob Halsey
e6dd608897
Rust: Issue #13453 - Empty enum variant names (#13454) 2022-09-20 22:52:13 +08:00
sverrevalskraa
179369811e
Support for international letters like øæå. (#13316)
Co-authored-by: Sverre Kristian Valskrå <Sverre.Valskra@skatteetaten.no>
2022-09-20 10:04:27 +01:00
miyucy
1f9f94066a
[Ruby] Change constants lookup methods in enum class (#13285)
* [Ruby] Add missing block ends

* [Ruby] Change constants lookup methods in enum class

* Update ruby samples
2022-09-20 13:41:26 +08:00
0xNF
d75b7b6194
[Dart] Remove toString() call in enum TypeTransformers (#13452)
* Updated samples

* [Dart] Removed 'toString' check on enum TypeTransformers (#12167)
2022-09-20 13:22:31 +08:00
Elton H.Y. Chou
4a2845152d
[python-experimental] Fix error message (#13471)
* fix error message formatting

* add more infos in error message
2022-09-19 15:40:53 -07:00
snebjorn
54e712a424
fix(typescript-angular): compile error with queryParamObjectFormat and tsc --strictNullChecks (#13431)
fixes #13429
2022-09-19 21:06:50 +02:00
Julian Kalinowski
af0c9d2ca4
[kotlin] fix enum default values (#13404)
* [kotlin-okhttp]: fix enum default parameters

* [kotlin-retrofit]: add enum support

* update samples
2022-09-19 14:22:50 +01:00
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
Kevin Bannier
d48209e297
fix: incorrect boolean literal in unit tests [python-flask] (#13397)
Co-authored-by: Kevin Bannier <kevin.bannier@outlook.fr>
2022-09-17 22:26:54 +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