197 Commits

Author SHA1 Message Date
William Cheng
6b80410bf3
update CI to install v1.18 (#14607) 2023-02-03 16:34:43 +08:00
William Cheng
0cf5ed619d
Add a new Python client generator - python-nextgen (#14157)
* add python-nextgen generator

* remove client_side_validation from model

* remove configuraiton import from models

* add inheritance support

* update test requirements, tox

* add typings, pydanic to models

* add test model

* minor improvements

* add enum support

* add typing for parameters, remove validations

* add oneof, anyof support

* fix default value

* fix deserialization, api tests passed

* private variable naming, update tests, all tests passed

* remove six

* remove nose

* update doc

* remove sortParamsByRequiredFlag option

* add parameter validation

* add validation tests

* simplify Field()

* remove previous required parameter validation

* improve parameter handling

* support discriminator mapping

* better typing discriminator mapping

* format test code

* fix tests

* fix oneOf from_dict, add test

* add set validation test

* fix nested oneof serialization, add tests

* add model import

* remove models. prefix

* remove import models

* remove model import from api

* simplify from_dict

* add typing for return

* skip pydantic import in return type

* fix tests, fix enum

* restore more enum schema tests

* uncomment enum integer test

* clean up getfullargspec import in model

* clean up getfullargspec import

* fix deserilizatoin for nested oneof

* minor fixes, add tests

* fix regular expression

* add aiohttp samples, add tests

* remove default content type to json

* update template

* fix select accept, content-type

* move tests

* move tests

* fix url query parameters

* fix list

* fix samples

* fix param pydantic, add list as reserved word

* fix auto-generated doc

* fix readme

* fix list, fix special variable name with var_

* fix Literal in python 3.7

* fix default configuration

* fix aiohttp tests

* set default api client instance

* deprecate get_default_copy method

* fix enum model

* fix enum serializatio/deserialization

* add github workflow support

* add regular expression validator

* add enum validator

* better model import

* fix file, remove x-py-import-models

* rename local var

* better model example

* fix regular expression warning, add special_name test, whitelist schema

* skip self import

* update samples

* various fixes

* add base64, json as reserved word

* add http signature support

* add http signature test

* add additioanl properties support in python client

* add decimal support

* use strictstr instead of constr

* fix test with virtualenv

* add nullable support

* add readonly support

* add model name caching

* fix circular reference import

* add onelook discriminator lookup

* add tests

* update samples

* fix locale

* Fix client legacy generator asyncio README code example

* test python-nextgen in circleci

* fix pom.xml

* update python to 3.7.15

* test with python 3.7.12

* various updates

* fix python legacy
2022-12-17 16:05:47 +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
Justin Black
6158274f65
Adds openapi v3.0.3 unit test spec, includes test cases, autogenerates model tests with them (#12619)
* Adds draft6 tests and python file reader

* Adds processing of multiple files

* Moves test examples into a different component so component schemas can be booleans

* Excludes boolean schema cases and some others that contain patternProperties

* Adds automatic test generation, template not quite working with indentation

* Turns on allOf tests, some failing

* Adds more generated components and tests

* Adds enum tests

* Turns on all of themissing tests

* Adds exclmax and min exclusion reasons

* Adds items test cases

* Adds maximum

* Adds maxItems

* Adds maxLength

* Adds maxProperties

* Adds minimum

* Adds minItems

* Adds minLength

* Adds minProperties

* Adds multipleOf

* Adds not

* Adds oneOf

* Adds pattern

* Adds patternProperties

* Working on properties examples, partial fix for escaped characters

* Further improves example string escaping

* Fixes properties test cases

* Adds draft6 test samples license

* Adds ref

* Finishes ref

* Adds remoteRef

* Adds required

* Improves required testing

* Fixes build error / javadoc warning

* Fixes uniqueItems bug in python-experimental

* Turns all tests back on

* Fixes 2 failing tests, all python tests pass

* Fixes java npe errors

* Fixes formatting of tests, indentation fixed

* Test fase name fixed to toTestCaseName, docstring added to ObjectWithTypeBooleans

* Fixes typo

* Adds test deletion to samples generation, samples regenerated

* Updates python-exp unit test sample, includes new ref examples
2022-07-01 13:46:02 -07:00
William Cheng
0b2cb06229
[CircleCI] improve execution time (#12253)
* add cache folder, remove mvn install

* debug

* update test

* fix cache
2022-04-30 16:43:39 +08:00
William Cheng
5eacc0d09f undo changes to CI/circle_parallel.sh 2022-03-29 14:00:05 +08:00
William Cheng
e268f46d76
Test PHP client in Travis CI (#11996)
* test php in circleci node 2

* restore image

* install php 8.1.4

* install plugin

* install libonig-dev

* install libzip-dev

* test php in travis

* rehash
2022-03-29 13:43:38 +08:00
William Cheng
69c69df5f2
[CircleCI] update image (#11929)
* use supported images from circleCI

* skip scala-httpclient test

* new way to install r

* skip r test

* test go only
2022-03-29 10:58:00 +08:00
Justin Black
42f3258faa
Turns on python-experimental CI tests (#11390)
* Installs python3.9 in node3

* Moves python clients into separate node so they can use a docker image

* Installs java and maven into docker

* Switches off some python tests
2022-01-24 15:44:38 -08:00
Justin Black
ffe5df8fa1
Turns python-legacy CI back on in circle, fixes python-legacy test (#11326)
* Turns python-legacy CI back on in circle, fixes python-legacy test

* Installs python 2.7 into circleci node 3

* Python 2.7 version changed to 2.7

* Switches back to py2714
2022-01-16 17:12:38 +08:00
William Cheng
4cece10bae
rebalance circleci tests (#10727) 2021-10-29 13:38:16 +08:00
William Cheng
026dd8d5f8
Move TypeScript, JavaScript tests to CircleCI (#10510)
* move ts, js tests to circleci

* set NODE_ENV

* curl -k

* comment out haskell installation
2021-10-02 15:38:05 +08:00
Pi Delport
30a37b3d8c
ci(drone): fix duplicate pipeline names (#10437)
Drone requires unique pipeline names, which PR #10423 (5c45465) missed.
2021-09-22 11:12:53 +08:00
Pi Delport
5c45465a97
ci(drone): use parallel pipelines (#10423)
Docs: https://docs.drone.io/pipeline/configuration/#multiple-pipelines
2021-09-21 11:23:04 +08:00
Jon Schoning
1247e77453
[haskell-http-client] add ability to choose additional characters in querystring which should not be encoded (e.g. "+" or ":") (fixes #3459) (#10424) 2021-09-19 02:02:22 -05:00
William Cheng
483a13f3e1
Test Python clients in CircleCI (#10354)
* test python in node3

* install python3

* install python 3.6

* use pyenv

* run with 3.5.2

* install py 3.8.9

* fix folder name

* install via pyenv

* list pyenv

* install 3.6.3

* rearrange test

* Revert "rearrange test"

This reverts commit 1b075ed97ce95c94fb1d15e9a9ffbcbde3b46f1b.

* only test py3
2021-09-09 12:43:55 +08:00
Peter Leibiger
22db406c35
[ci] Move openapi-generator build/docs/samples to github actions (#9550)
* [ci] Move openapi-generator build/docs/samples to github actions

* Naming

* Test failure on samples and docs

* Revert code changes after successful docs/sample failure
2021-05-24 10:59:35 +08:00
Peter Leibiger
b8c5a647e0
[dart][ci] Move Dart samples from CircleCI to Github actions (#9515)
* [dart] Move Dart samples from CircleCI to Github actions

* Fix format failing with latest Dart version

* Workflow naming

* Split dart samples depending on version

* use fixed version to prevent flaky builds

* Change branch pattern for release branches
2021-05-21 14:45:50 +08:00
William Cheng
456023b77c
Update erlang-server dependencies (#9414)
* update erlang-server dependencies

* reenable erlang-server test

* test with 2.7.0

* use only cowboy

* comment out erlang server test
2021-05-12 17:08:59 +08:00
William Cheng
a63912ee1e
add --allow-different-user (#9439) 2021-05-10 20:23:38 +08:00
William Cheng
ec085713ce
[Erlang] migrate CI to drone.io (#9406)
* test erlang client, server in drone.io

* rearrange tests, add server folder

* comment out erlang server tests
2021-05-06 10:42:46 +08:00
William Cheng
ad3ecadd75
Move ensure up-to-date script to drone.io (#9339)
* move ensure up-to-date to drone.io

* fix tests

* Revert "fix tests"

This reverts commit ea5efd3b3b45e7e7720b2aa893403aed8a458d9f.

* skip 2.0 tests

* use mvnw

* fail fast

* fix meta-codegen

* test java 11 first
2021-04-26 22:08:49 +08:00
Peter Leibiger
47e292c0e7
[dart][dart-dio] Remove sample formatting from dart-dio-next (#9121) 2021-03-31 16:45:47 +08:00
William Cheng
773a8d8a08
move dart test to node 2, remove oas v2 dart tests (#9028) 2021-03-21 10:53:00 +08:00
Peter Leibiger
3d038b74fd
[dart][dart-dio] Next-gen dart-dio generator (#8869)
* [dart-dio] Remove old Dart 1.x templates

* [dart-dio] Initial version of a next-gen Dart Dio generator

* Fix a couple readme links and examples

* Fix import in testcase

* Add integration tests to master POM

* Run initial dart format and improve some base formatting

* Generate docs

* Use integer matchers in test for content-length

* Separate more built_value specific files

* Fix mustache partial path

* Update pubspec template

* Fix tests after mock lib updates

* Generate with new built_value pre-release

This solves the problem of not being able to serialize null.

* Update built_value dependency

* Regenerate after merge

* Regenerate tests

* Fix missing byte response cast

* Update dio to 4.0.0-prev1

* Run format

* Ignore unused imports in inheritance classes

* Update mock test library

* Update docs

* Make a couple variables final

* Update and freeze dio dependency

* Update generator doc

* Add a new option to post processes all dart output at once

This is much faster than individual files. The committed samples should be formatted since Dart is very opinionated and it makes diffs in PRs much easier to read.
Due to this, we also need to format in CI, otherwise there is a git diff.

* Test some CI stuff
2021-03-20 12:26:56 +08:00
William Cheng
b203539869
update doc, move bitrise.yml (#8547) 2021-01-27 13:19:59 +08:00
William Cheng
cbd2038cb5
[Swift] move swift config files under ./bin/config (#8539)
* move swift config files under ./bin/config

* update bitrise config
2021-01-26 19:06:53 +08:00
Bruno Coelho
3a56e3818f
[Swift 5] remove old swift sample (#8280)
* [swift] remove old swift sample

* [swift] update bitrise.yml

* [swift] update unit tests
2021-01-25 13:34:10 +08:00
William Cheng
cd936a66fd
[Nim] test the petstore client in drone.io (#8466)
* test nim client in drone.io

* trigger build failure

* Revert "trigger build failure"

This reverts commit 7253c8ad3bb72456f2995134701c6bbce8f31c64.
2021-01-19 10:52:46 +08:00
William Cheng
1df719801e
Add a new crystal client generator (beta) (#8304)
* add crytsal client generator

* update samples

* update doc

* regenerate spec

* regenerate spec

* various fixes

* test crystal in circleci

* test crystal client in drone ci

* Revert "test crystal client in drone ci"

This reverts commit 317f2cf2a09f902c08ced214e8e5802fa79c3de8.

* fix install

* fix installation

* test crystal in travis

* cache image

* add --cache-from

* update doc

* run petstore with mvn

* install crystal

* fix install crystal

* sudo mvn

* run server

* using mvnw

* fix form or body parameter

* remove crystal from circleci

* fix test

* remove cache-from

* update doc
2021-01-07 17:10:22 +08:00
William Cheng
681d23d2d3
use local deno install sh (#8126) 2020-12-09 10:28:05 +08:00
William Cheng
08c8296e33
test openapi3 java native in drone.ci (#8001) 2020-11-23 16:01:34 +08:00
William Cheng
d5a7102785
[Protobuf] tests protobuf-schema generator in CI (#7841)
* test protobuf schema

* remove sudo

* use different image

* proto files

* test with go

* test with go

* test with go

* test with go

* break the build

* Revert "break the build"

This reverts commit 81c10e7d967c0cade55183438d5ec8a888b37033.

* remove comment

* move config

* remove old protobuf-schema.yaml
2020-10-31 14:43:21 +08:00
William Cheng
0707b4bb20
[Scala] setup Ivy cache directory (#6978)
* use ivy2 cache

* use ~/.ivy2 cache dir

* add pom.xml to openapi-generator-ignore

* update scala-akka sample

* use ~ for home directory
2020-07-18 15:48:47 +08:00
William Cheng
49f088ec8e
[CircleCI] rebalance tests (#6981)
* rearrange tests

* move java tests to others
2020-07-18 15:47:46 +08:00
William Cheng
47b4e16420
Remove JDK7 tests in CircleCI (#6890)
* remove jdk7 tests in circleci

* test microprofile-rest-client in jdk8
2020-07-09 17:46:52 +08:00
William Cheng
55d8e759de
Update bitrise.io config (#6661)
* update bitrise config

* update bitrise.yml

* add back --no-snapshot-updates
2020-06-15 15:50:10 +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
Sebastien Rosset
54e2574013
[Java][Jersey2] Fix typo and script, Log enhancements, HTTP signature, deserialization (#6476)
* Mustache template should use invokerPackage tag to generate import

* fix typo, fix script issue, add log statement for troubleshooting

* Add java jersey2 samples with OpenAPI doc that has HTTP signature security scheme

* Add sample for Java jersey2 and HTTP signature scheme

* Add unit test for oneOf schema deserialization

* Add unit test for oneOf schema deserialization

* Add log statements

* Add profile for jersey2

* Temporarily disable unit test

* Temporarily disable unit test

* fix typo in pom.xml

* fix duplicate jersey2 samples

* fix duplicate jersey2 samples

* fix duplicate artifact id

* fix duplicate jersey2 samples

* run samples scripts
2020-05-31 22:45:01 +08:00
Jim Schubert
fb57b602c2
[ci] Execute maven and verify with no-snapshot-updates (#6415) 2020-05-25 14:30:12 -04:00
Jon Freedman
950508fd4b
[Java] Generate valid code if no Authentication implementations present (#5788)
* generate valid code if no Authentication implementations present

resurrects https://github.com/OpenAPITools/openapi-generator/pull/2861

* remove what I assume are human generated test cases

* need to iterate over authMethods in order to pull out name

* fix another test

* update more tests

* rename hasTokenAuthMethods to hasApiKeyAuthMethods

* remove duplicate methods, fix hasHttpBearerMethods check

* update templates

* update windows java-petstore files

* update windows java-petstore files

* re-generate

* re-generate

* restore samples.ci tests

* restore samples.ci tests
2020-05-23 18:36:03 +08:00
Januson
c49d8fda8e
[M][REQ][JAVA]: Add option to generate arrays with "uniqueItems" true as Sets rather than Lists (#5466)
* [REQ][JAVA]: Add option to generate arrays with "uniqueItems" true as Sets rather than Lists
 - Update Java code generation to use sets instead of lists when uniqueItems is set to true
 - Add import resolution for sets
 - Add tests and fix broke tests

resolve #5254

* Update Javascript, Perl, Python and Ruby to preserve current functionality.

* Switch set implementation to LinkedHashSet

* Fix missing import for uniqueItems used on param.

* Fix missing import and return type for responses with uniqueItems

* Fix default values for array of enum

* Update generated samples

* fix merge issue

* Update generated samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-05-21 13:27:57 +08:00
William Cheng
26830bf3bc
Mark swift4 generator as deprecated (#6311)
* mark swift4 generator as deprecated

* add new files
2020-05-15 20:50:45 +08:00
William Cheng
deec5da8a7
[Java][jersey2] replace jersey2 with jersey2-experimental (#6251)
* replace jersey2 with jersey2-experimental

* better handling of oauth

* add jersey2 java8 samples

* add dependency to test pom

* fix test, update doc
2020-05-12 18:27:33 +08:00
DK99
5693cb9863
[c-sharp] generator added CancellationToken to async api calls (#6243)
* csharp generator CancellationToken added to async methods

* update samples
2020-05-10 23:55:48 -04:00
William Cheng
1d606499ee Merge remote-tracking branch 'origin/5.0.x' 2020-05-06 22:51:05 +08:00
William Cheng
9afa154a5e
[aspnetcore] test petstore samples in drone.io (#6148)
* test aspnetcore 3.0/3.1 in drone.io

* switch images

* trigger build failure

* Revert "trigger build failure"

This reverts commit f5c2c1578db1a0e7b90a668f095e1d6eb1766fca.
2020-05-04 15:09:28 +08:00
Ukonn Ra
f4fa00fefa
Add async native Java Client (#4721)
* Add async native Java Client

* UPDATE: Reformat the samples

* test java native async in drone.io

* update test count

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-05-03 16:06:18 +08:00
William Cheng
ec0db2f1ee
Test java 11 native client in drone.ci (#6144)
* test java 11 native clientin drone.ci

* trigger build failure

* Revert "trigger build failure"

This reverts commit e52ad39ec1c6508864fd7c3c8513e56a2eef6539.
2020-05-03 14:46:17 +08:00
William Cheng
faf6f197be Merge remote-tracking branch 'origin/master' into 5.0-sync-master 2020-04-17 15:51:00 +08:00