140 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
a79aad8420
Prepare 7.13.0 (#20758)
* Revert "v7.12.0 release"

This reverts commit 073723cb4d41187f839fbb46565d109293fa22d7.

* set version to v7.13.0-SNAPSHOT

* update samples

* update doc
2025-02-28 13:48:36 +08:00
William Cheng
1fa07bf46c
Prepare 7.12.0 (#20512)
* Revert "v7.11.0 release (#20508)"

This reverts commit a7240eeefeedeefe7fc80ef22747dfc67e126324.

* prepare 7.12.0 snapshot version

* update samples

* update readme
2025-01-21 00:10:09 +08:00
William Cheng
654f62ce3c
Prepare 7.11.0 (#20130)
* Revert "prepare 7.10.0 release (#20128)"

This reverts commit 12dfe8fe74a1515d1e69e00df9abe4128aa44160.

* update to 7.11.0-SNAPSHOT, update samples

* update docs
2024-11-18 20:15:29 +08:00
William Cheng
e2c458b9ea
Prepare 7.10.0 (#19809)
* Revert "prepare 7.9.0 release (#19808)"

This reverts commit 4145000dfebe7a9edea4555c8515383da7602458.

* prepare 7.10.0 snapshot

* update doc

* update samples
2024-10-08 11:21:54 +08:00
William Cheng
91da2fd240
Prepare 7.9.0 snapshot (#19386)
* Revert "v7.8.0 release (#19385)"

This reverts commit 6bdc452f92d49dcac7ac21dfe8751c8cc4267b98.

* update samples for v7.9.0-snapshot
2024-08-19 16:14:51 +08:00
William Cheng
20cfce0b4a
Prepare v7.8.0 (#19048)
* Revert "v7.7.0 release"

This reverts commit f3dd32385e02065ad298801ca11b8871bcb3a92a.

* prepare v7.8.0

* update readme

* update doc

* update samples
2024-07-02 16:45:53 +08:00
William Cheng
741bf0c035
Prepare 7.7.0-SNAPSHOT (#18709)
* Revert "7.6.0 release"

This reverts commit d76f9d32d11a03be2b40ebff728ef0ff86332fcb.

* prepare 7.7.0 snapshot in master

* update samples
2024-05-20 17:27:17 +08:00
William Cheng
807250a430
Prepare 7.6.0 (#18412)
* Revert "v7.5.0 release"

This reverts commit 1eafe2aebf33b13bee0ead66d62a6436e7db059d.

* update master to v7.6.0 snapshot

* update readme

* update samples
2024-04-17 19:05:37 +08:00
William Cheng
4ff7e0ec3f
Prepare 7.5.0 snapshot (#18068)
* Revert "7.4.0 release"

This reverts commit eda049348425171df772a7b9087cc97db718cfda.

* prepare 7.5.0 snapshot version

* update samples

* update doc
2024-03-11 11:10:52 +08:00
Ross Bender
cf2435f335
Add support for controlling output of OpenAPI Generator version in generated files (#17952)
* add initial openapi config and java generated files

* add java implementation for adding generator version

* regenerate sample client files

* remove tabs

* only show generated version if build info exists

* set build info for batch generation

* update generator doc for new global flag

* use existing property for generator version

* update templates to include generator version

* update templates for better generator version syntax

* revert undesired changes

* regenerate samples for openapi client

* update templates to correct formatting/newlines

* correct description text and add to usage doc

* add generator cli option for all codegen types

* use more concise version info; update existing codegens to support new prop

* correct wrong prop reference

* add initial test coverage for new prop

* update last (scala) templates with new prop

* update samples after upstream merge

* use consistent version output

* use better sample project id/name

* revert using option for generator version in templates
2024-03-09 15:52:08 +08:00
martin-mfg
9afea50cab
use map/array model class only if it is generated (#17612)
* fix

* tests

* generate samples

* refactor
2024-01-29 21:35:21 +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
martin-mfg
64f2cad9e8
fix #17258 - use model class only if it is generated (#17490)
* fix  #16797 and #15796 spring child constructor missing parent params

* root cause and update the DefaultCodegen.java to add missing property when with multi inheritance

* rollback SpringCodegen.java

* update samples

* rollback with master cause #16992 fixed this issue too

* still using orignal design

* catchup master

* catchup master

* catchup master

* fix

* add tests

---------

Co-authored-by: dabdirb <dabdirb@gmail.com>
2024-01-05 10:30:28 +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
Tiffany Marrel
c2f635a330
fix use of isBasic and isBasicBasic and isBasicBearer and isHttpSignature in documentation (#15443)
* [ada] fix use of isBasic condition

* [apex] fix use of isBasic condition

* [asciidoc] fix use of isBasic condition

* [python] fix use of isBasic condition

* [csharp C#] fix use of isBasic condition

* [htmlDocs] fix use of isBasic condition

* [Ruby] fix use of isBasic condition

* [scala] fix use of isBasic condition

* [julia] fix use of isBasic condition

* [Objective-C objc] fix use of isBasic condition

* [GraphQL] fix use of isBasic condition

* [MarkDown] fix use of isBasic condition
2023-06-01 09:47:00 +08:00
Tiffany Marrel
2b19d5f94d
[Ruby] fix documentation of API authorization in README files (#15353)
align wording across generators
2023-05-09 14:17:34 +08:00
Beppe Catanese
68b944e6e6
Preserve order of securitySchemes (#14536)
* Remove alphabetical sort

* Update integration testing expectations

* Regenerate files
2023-02-10 22:20:19 +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
Nathan Baulch
5d68bd6a03
Fix thousands of spelling typos (#10272) 2021-08-28 22:58:24 +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
Peter Leibiger
f7b93ebdf2
Update fake API to contain sample with binary body (#9610) 2021-05-29 10:26:01 +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
78bf3adc4a
[core] Initial FeatureSet structures and definitions (#3614)
[core] Initial FeatureSet structures and definitions
Add default feature set to DefaultCodegen
Initial FeatureSet definitions for:

*  ada 
*  android 
*  apache2 
*  asciidoc 
*  aspnetcore 
*  avro 
*  bash 
*  c 
*  clojure 
*  cpp-pistache-server 
*  cpp-qt5-client 
*  cpp-qt5-qhttpengine-server 
*  cpp-restbed-server 
*  cpp-restsdk 
*  cpp-tizen 
*  csharp 
*  csharp-nancyfx 
*  csharp-netcore 
*  cwiki 
*  dart 
*  eiffel 
*  elixir 
*  elm 
*  erlang 
*  flash 
*  fsharp-functions 
*  go  Client/Server
*  graphql-nodejs-express-server 
*  graphql-schema 
*  groovy 
*  haskell 
*  haskell-http-client 
*  java 
*  jmeter 
*  kotlin 
*  kotlin vertx 
*  kotlin-server 
*  kotlin-spring 
*  lua 
*  mysql 
*  nim 
*  nodejs 
*  nodejs-express 
*  objc 
*  ocaml 
*  openapi 
*  openapi-yaml 
*  perl 
*  php 
*  php-laravel 
*  php-lumen 
*  php-silex 
*  php-slim 
*  php-symfony 
*  php-ze-ph 
*  powershell 
*  protobuf 
*  protobuf-schema 
*  python 
*  python-aiohttp 
*  python-blueplanet 
*  python-experimental 
*  r 
*  ror 
*  ruby 
*  ruby 
*  ruby-sinatra 
*  rust 
*  scala-akka 
*  scala-finch 
*  scala-gatling 
*  scala-http-client 
*  scala-lagom 
*  scala-play 
*  scalatra 
*  scalaz 
*  spring 
*  static docs 
*  swift 
*  typescript
2020-01-11 16:20:47 -05:00
Jim Schubert
376e419d0b Support models with multi-level hierarchy (via roxspring) (#4503)
* Example of broken multi-level hierarchy

* Support for multiple levels of hierarchy in model objects

* Support for multiple levels of hierarchy in generators

* Regenerated samples

* Temporarily skip scalaz sample verification, which is having issue with Java version in CI container

* Re-enable scalaz in verify samples

Co-authored-by: Rob Oxspring <roxspring@imapmail.org>
2019-12-27 15:42:32 +08:00
William Cheng
c3535cf9ca
Add test cases to cover different collection formats (#3640)
* add test cases to cover different collection format

* add space params to retrofit 1.x

* add space params to retrofit 2.x

* rename url to localVarUrl

* fix exception in haskell servant
2019-08-15 11:09:12 +08:00
Matthieu Berthomé
ee43cc1520 handle composed schemas in InlineModelResolver (#2112)
* handle composed schemas in InlineModelResolver

* fix unit test -> TestUtils.parseSpec

* update samples

* fix samples

* update samples

* update samples

* add new files
2019-05-08 10:19:15 +08:00
William Cheng
f015363dbd update samples 2019-03-25 22:44:05 +08:00
Justin Black
b67318ef21 Adds spec additionalProperties + nullable examples (#2405)
* Adds v2 spec additionalproperties examples, adds v3 spec nulllable model example, updates samples

* Remaining samples updates

* Adds csharp generator update to handle models with multilevel parent types, which works for the AdditionalPropertiesObject model, samples updated
2019-03-20 15:31:28 +08:00
Justin Black
9ec594eec5 [Spec] adds XmlItem model and route for xml testing (#1883)
* Adds xmlitem model and route, rest-assured Api suffix fix, updates pytest and pytest-cov versions

* Adds python client sample files

* Adds samples update

* Adds rest-assured sample client update

* Adds sample updates in ensure-up-to-date

* Changes rest-assured files back to master version, removes fix for issue #13

* Updates samples
2019-01-26 17:26:38 +08:00
Justin Black
539ec23298 [python-client] Add model default values (#1776)
* Adds two models to the v2.0 spec, uses examples as defaults in python client

* Adds array default and type_holder_default and type_holder_example tests

* Re-generated python security client with ./bin/security/python-petstore.sh

* Changes comment text, rebased master

* Updates client + server samples

* Adds missing samples updates

* Changes python client to look for true or false with booleans in toDefaultValue

* Changes boolean casting to use Boolean.valueOf

* Adds deserialization fix for python tests

* Changes Mock to namedtuple in python deserialization tests

* Actually remove unittest.mock
2019-01-09 11:18:35 +08:00
Jérémie Bresson
a7dfc650b6 Swagger parser update: 2.0.8-OpenAPITools.org-1 (#1721)
* Update Swagger-Parser Version

* Update samples

* surpress javadoc warning

* fix TS tests

* Set version to 2.0.8-OpenAPITools.org-1
2018-12-22 18:12:08 +08:00
William Cheng
46a4ffe64c
Skip model generation if it's a top-level map or array (#1296)
* update samples

* remove string boolean map spec

* add logic to skip array alias being generated as model

* fix alias to array

* remove unused ruby files

* remove unused ruby (oas3) files

* unalias response schema

* fix NPE when no model defined

* fix ruby openapi3 script

* update samples

* add global openapi, schemas for unaliasing

* minor code cleanup/refactoring using globalSchemas

* Revert "minor code cleanup/refactoring using globalSchemas"

This reverts commit 20a2bbc6fc4267a0e0768dcf5f15d4194ce9647b.
2018-11-26 22:01:53 +08:00
meganemura
b9949e1a8e Generate a ruby-client sample for OpenAPI 2.0 (#1482)
* Move output directory for bin/openapi3/ruby-client-petstore.sh

$ git mv sample/client/petstore/ruby sample/openapi3/client/petstore/ruby-client

* $ bin/ruby-client-petstore.sh

* Run bin/ruby-client-petstore.sh in bin/utils/ensure-up-to-date
2018-11-19 17:02:19 +08:00
William Cheng
aced89ff8b
Add group parameter support to PHP client (#1337)
* add group parameter support to php template

* more update for group parameter

* fix call to protect function

* fix missing $

* update based on feedback

* create fake endpoint to test group parameters

* sync fake petstore spec v2, v3

* fix php doc for group parameters

* update petstore samples

* update fake petstore spec v2

* update petstore samples

* fix spec and update samples
2018-10-29 15:42:32 +08:00
William Cheng
3d7a019524
update samples and reenable ensure-up-to-date (#1304) 2018-10-24 13:56:24 +08:00
William Cheng
f0425d77ef
[Ruby] Better handling of operationID starting with a number (#719)
* better handling of operationId starting with numbers in Ruby

* update Rubocop to use Layout
2018-08-02 22:00:50 +08:00
John Wang
0bffdf2463 [Golang][client] fix for schema definition name file (#433)
* fix schema/definition name as 'file'

* update samples

* Trigger CI due to previous Shippable race condition

* add fix with toModelName(openAPIType)

* update tests for file schema/definition name

* Update 3.0 test spec

* update samples

* update samples for jaxrs-cxf

* Trigger CI due to previous Shippable race condition

* add back explode
2018-07-05 20:32:24 +08:00
William Cheng
862fe79f32
Minor improvement to Go client generator, move test case (#430)
* move test cases to under fake endpoint

* remove trailing spaces in the template

* update samples

* add new file

* minor fix to OAS3 spec
2018-07-02 10:23:12 +08:00