23 Commits

Author SHA1 Message Date
Mattias Sehlstedt
1eee6038df
Fixes so that a oneOf schema with a single sub-schema is simplified (#21043)
* Fixes so that a oneOf schema with a single sub-schema is simplified when SIMPLIFY_ONEOF_ANYOF is set to true

* Adjusts oneOf_array test to ensure that it is generated as an interface instead of being simplified

* Update ruby samples so that they no longer refer to a model that is now gone due to the schema being simplified
2025-04-26 22:53:21 +08:00
William Cheng
ca260b2230 update ruby samples 2024-01-05 15:05:30 +08:00
Armand Mégrot
07a9257ee9
[Ruby][client] Handle enums (and other scalars) in oneOf and anyOf schemas (#17515)
* Handle enums in oneOf and anyOf schemas

* Update specs
2024-01-05 15:01:08 +08:00
William Cheng
809d7151c6
remove auto-generated ruby tests (#17402) 2023-12-15 14:47:15 +08:00
martin-mfg
2ca99bdf8e
use model class for request body with additionalProperties (#16613)
* try out simple fix

* add test case

* generate samples
2023-09-23 13:07:53 +08:00
William Cheng
d7311cd5cd
[Ruby] add property, parameter name mapping (#16191)
* add property, parameter name mapping support to ruby generators

* update samples
2023-07-27 09:48:53 +08:00
William Cheng
7252d1a698
[Ruby] add anyOf support (#16147)
* add anyOf support

* remove valid? from oneOf template
2023-07-21 11:38:07 +08:00
William Cheng
ddc2b3e560
Add tests for oneOf models in ruby client (#16137)
* add test for oneOf model in ruby

* add new files

* add tests for oneOf model without discriminator
2023-07-20 17:35:40 +08:00
William Cheng
6788f43af0
Better handling of Inline schema (#15682)
* skip allOf inline subschema created as $ref

* add option for fallback

* add back atleastonemodel

* add log

* update java, kotlin, js samples

* update tests

* fix native client test

* fix java client errors by regenerating test files

* clean up python

* clean up powershell

* clean up php

* clean up ruby

* update erlang, elixir

* update dart samples

* update ts samples

* update r, go samples

* update perl

* update swift

* add back files

* add back files

* remove outdated test files

* fix test
2023-06-11 15:35:58 +08:00
martin-mfg
b7f2b723aa
[JAVA] fix toUrlQueryString for BigDecimal (#15764)
* add MyImportTest.java

* fix original issue

* fix same issue for native library

* remove MyImportTest

* add test configs

* generate samples (again?)

* generate samples again

* generate samples again, undo pom.xml mistake [amended to retrigger circliCi]
2023-06-08 09:34:06 +08:00
Gabriel Mazetto
b97a4ad12a
Generate .gitlab-ci.yml files for Ruby template (#12750) 2022-07-03 17:52:32 +08:00
William Cheng
12cdacabbf
[Inline model resolver] better handling of inline responses and bug fixes (#12353)
* better handling of inline response schemas, bug fixes

* update samples

* add new files

* better code format

* remove unused ruby files

* fix java test

* remove unused js spec files

* remove inline_response_default_test.dart

* fix webclient tests

* fix spring tests
2022-05-13 10:17:59 +08:00
William Cheng
8330e16d66
Better inline model resolver to handle inline schema in array item (#12104)
* better support of inline schema in array item

* update tests

* update samples

* regenerate samples

* fix allof naming, remove files

* add files

* update samples

* update readme

* fix tests

* update samples

* update samples

* add new files

* update test spec

* add back tests

* remove unused files

* comment out python test

* update js test using own spec

* remove files

* remove unused files

* remove files

* remove unused files

* better handling of allOf with a single type

* comment out go test

* remove test_all_of_with_single_ref_single_ref_type.py

* fix inline resolver, uncomment go test
2022-04-20 10:28:15 +08:00
Peter Leibiger
15e9d4ed8c
Add example allOf with single ref (#10948)
* Add example allOf with single ref

* fix dart-dio-next handling of that case

* Refactor without vendor extension

* Regenerate newer samples
2022-04-12 13:52:53 +08:00
Jon Jensen
bd070308d9
[Java][*] Annotate deprecated operations and schemas (#9478)
Refs #3358

Ensure `deprecated` operations are annotated/documented as such on the
generated methods. Libraries updated:
  * [feign]
  * [google-api-client]
  * [microprofile]
  * [okhttp-gson]
  * [resttemplate]
  * [retrofit]
  * [retrofit/play*]
  * [webclient]
  * [vertx]

Ensure `deprecated` schemas are annotated/documented as such on the
generated classes/fields. Libraries updated:
  * [feign]
  * [google-api-client]
  * [jersey2]
  * [microprofile]
  * [native]
  * [okhttp-gson]
  * [rest-assured]
  * [resteasy]
  * [resttemplate]
  * [retrofit*]
  * [webclient]
  * [vertx]

Also fix two minor bugs to get the java sample tests working:

* Fix an invalid jackson-datatype-threetenbp version number in vertx/pom.mustache
* Fix a bad return type in webclient/api_test.mustache when uniqueItems=true

Since this commit updates petstore-with-fake-endpoints-models-for-testing.yaml,
several other samples were updated, but it's just new files to reflect the
deprecated schemas, so there should be no consequential differences.

Relevant bits of the spec:

* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#user-content-operationdeprecated
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#user-content-schemadeprecated
2021-07-19 10:27:03 +08:00
linnefromice
70616b541e
[Ruby] remove duplicated supportingFiles.add (#9108)
* remove duplicated supportingFiles

* modify examples - remove duplicated supportingFiles
2021-03-29 11:31:24 +08:00
William Cheng
7720c9f6bd update samples 2021-03-08 19:05:16 +08:00
Jiri Kuncar
8cb4741248
[go][client] Fix example value for non string enums (#8900)
* [go][client] Fix example value for non string enums

* regenerated samples
2021-03-08 18:11:50 +08:00
William Cheng
0be3fe6104
Set skipFormModel to true by default (#8125)
* set skipFormModel to true by default

* update tests

* regenerate ruby faraday client

* remove inline object spec files

* more clean up on inline object files

* update samples
2020-12-18 23:57:19 +08:00
Jim Schubert
60ceded171
[ci][cli] Moving ensures script to config-based batch generation of samples (#6509)
* Ensure CLI-level generator settings are available in additional properties

* Initial conversion to yaml configs

Configs prefix with 1- need to be manually evaluated.

* Add "other" configs not in ensure-up-to-date

* Add other/openapi3 files

* Cleanup all generation scripts

* Clean up: add missed configs and fix some openapi 3 diffs

* Move generate-samples script, error on batch failures

* Temporarily disable elm which requires skip validation of spec

* CI updates (todo: run all generators through appveyor or move to github workflows)

* Add success count to batch generation command output

* [samples] Regenerate

* Remove bin/windows

* Generate swift5 samples in bitrise

* Expand user input glob pattern

* Regenerate samples

* Update PR template

* Support config based generateAliasAsModel

* [samples] Regenerate

* [rust] Generate as alias for all samples configs

* [csharp] Move test staged file changes to in-directory

* Include "live" test files and ignore test cache files from samples.ci

* Remove concept of samples.ci staging

Generators support .openapi-generator-ignore, allowing maintainers to
explicitly ignore the regeneration of files which have been modified.

Note that the tooling does not overwrite test files whenever those files
exist, and it's not entirely necessary to add test files to the ignore
file.

* Re-add meta generator scripts

* Modify ensure-up-to-date to log stdout, so script does not look like it hangs on slower machines

* [csharp] Regenerate sample

* Set generateAliasAsModel CodegenConfigurator#toContext

This ensures the property (which is effectively a thread-local) gets set
as expected if the caller resets GlobalSettings as is done in the
GenerateBatch command.

* [rust] Regenerate samples

* Re-enable elm

* [java] Support OffsetDateTime example, fail ensures script on any generation error

* [samples] Regenerate

* Fix jersey2-java8 ignore file

* Fix elm spec validation

* Force UTC in sample generation to avoid timezone conflicts during generation (user vs ci)

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-06-09 18:28:58 +08:00
Jim Schubert
7e5f720f20
Remove deprecations 5.0 (#6060)
* [breaking] Enforce vendor extension naming convention

* [breaking] Rename system properties to global properties

* [docs] Update site with global properties list and usage explanation

* Use proper vendor extension casing in all templates

* Set remaining vendor extensions to convention of lower kebab-cased with x- prefix

* [samples] Regenerate

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

Before we were adding hasPathParams twice, once with !op.pathParams.isEmpty(), and then again with hasPathParams. This was probably caused by a mistaken merge.

This is causing the difference in samples

Co-authored-by: Richard Whitehouse <richard.whitehouse@metaswitch.com>

* [Samples] Regenerated!

* Fix -D conversion to additional-properties, missed in bat files

* JERSEY2 option changed

* [samples] Regenerate

* [scala][finch] Fix remaining vendor extensions format to conventino

* [scala] The -D option was replaced with --global-property

* [samples] Regenerate

* Fix -DskipFormModel usage which has been moved to --global-property skipFormModel=true

* [samples] Regenerate

Co-authored-by: Richard Whitehouse <richard.whitehouse@metaswitch.com>
2020-05-31 19:14:31 +08:00
William Cheng
db4c4917e2
migrate ruby samples to oas3 (#6414) 2020-05-25 23:02:30 +08:00
Jim Schubert
70ca93570e
[core][general] Add metadata file tracking to aid in "Golden Tests" regeneration (#6325) 2020-05-22 16:48:32 -04:00