Commit Graph

1114 Commits

Author SHA1 Message Date
William Cheng
4ac5ba13ca fix script permission 2019-12-18 17:03:34 +08:00
Alexander Eggers
bb93a3b1e2 [Kotlin][Client] Request date converter (#4750)
* Added new cli option to define the request date converter

* Fixed a few build errors

* Update api.mustache

* Fixed api mustache

* Removed unused import

* Fixing mustache templates

* Tweaking mustache templates

* Added sample and new bat file

TODO create new openapi 2.0 source file to simulate the datestring via schema.

* Tweaking mustache templates

* Updated templates and samples

* Fixed build error

* Updated samples

* Fixed path
2019-12-18 10:22:29 +08:00
Jim Schubert
399e73e5d8 [samples] Fix --batch option for slim4/feign and regenerate (#4810) 2019-12-17 16:21:58 +08:00
William Cheng
adbed055dd
CI improvements (#4791)
* run all script in circleci

* test kotlin clients

* add new files

* undo chanages to circleci script

* update samples

* update bitwise config

* fix typo
2019-12-15 18:39:04 +08:00
Javier Luque Sanabria
bb4af91bbd Feature/kotlin/library/retrofit (#4518)
* Some clean code.

* Add support for retrofit2 in models and apis. Need work in ApiClient, but it's not urgent.

* Add ApiClient with retrofit2 support.

* Remove unnecessary package.

* Add scripts to generate samples.

* Generate sample of retrofit2

* Change toUpperCase to toUpperCase(Locale.ROOT) to fix compile.

* Added GSON library when it's needed

* Fix typo.

* Add some missing common files.

* Execute bin script.

* Remove copy&paste error in script.

* [kotlin] update outdated files

* Fix apis with no params.

* Add missing import in ApiClient

* Add support for CSV, SSV, TSV, PIPES, SPACES in retrofit 2 library.

* Fix package name.

* Execute kotlin-client-retrofit2.sh script.

* force rebuild.

* execute script again.

* Add missing imports from okhttp3.
@Deprecated has a message param that java not. Add it with a default message.

* Execute retrofit2 script.

* Rerun script.
2019-12-15 18:26:37 +08:00
Alexander Eggers
02f5cb1a65 [Kotlin][Client] Added new option to enable moshi code generator (#4781)
* Added new option to enable moshi code generator

* Tweaking Serializer template
2019-12-14 14:39:16 +08:00
Paul Gooderham
a9494ac1a3 [REQ] Java Microprofile REST Client Template (#4713)
* Add a Java Library called microprofile.

* Fix formatting
2019-12-10 11:41:50 +08:00
Sami Jaber
da44e458e0 typescript-fetch: Fix compatibility with noImplicitAny TS rule (#4711)
* Fix compatibility with noImplicitAny TS rule (required with CRNA app)

*  new file added with bin/typescript-fetch-petstore.sh

* missing files with bin/typescript-fetch-petstore-all.sh

* Update modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache

Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache

Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache

Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache

Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>

* changed files after bin/typescript-fetch-petstore-all.sh

* re-generate samples, fix windows typescript fetch script
2019-12-06 14:17:46 +01:00
Alexander Eggers
467fb74a21 Added support for consuming OpenApi 3.0 nullable required fields (#4696) 2019-12-06 00:05:03 +08:00
Oleh Kurpiak
ba3af50384 [#4025] custom java annotations (#4026)
* custom java annotations
2019-12-03 08:09:39 -05:00
Thibault Duperron
2dc0220874 Add mutable model option to kotlin generators (#4115)
* Add mutable model option to kotlin generators

fix #3803

* doc

* Change template name to modelMutable

* Samples
2019-11-27 18:04:43 +08:00
Bruno Coelho
6bf5741fd1 [swift] Introduce result type (#4511)
* [swift] introduce result type as response library

* iOS - run petstore samples

* [swift4] add result sample to testing pipeline

* [swift] update docs with result type

* [swift] update result visibility

* [swift] update docs
2019-11-26 17:01:26 +08:00
Bruno Coelho
d5c7c9c9b7 [swift] add option for non public api (#4556)
* [swift] implement non public api

* [swift] add petstore for non public api

* [swift] fix error in extension that cannot be internal

* [swift] update docs
2019-11-25 17:19:50 +08:00
Jim Schubert
dd6257917d Add php-slim4 config for batch/ci (#4581) 2019-11-23 13:27:15 +08:00
Esteban Gehring
87a9fa3808
add typescript-redux-query to ensure-up-to-date script (#4574)
* add typescript-redux-query to ensure-up-to-date script

* Update typescript-redux-query samples

* fixup! Update typescript-redux-query samples
2019-11-22 15:25:17 +01:00
William Cheng
a1fc114efa
[Swift] minor fix to scripts (#4577)
* minor fix to swift4 scripts

* fix script

* update bitrise config

* update doc

* run swift4_test_all.sh directly

* make swift4 script executable
2019-11-22 21:42:32 +08:00
Pete Johanson
70954cabde New generator: typescript-redux-query (#3824)
* Initial work on a redux-query client generator.

* Update to match the required redux-query version w/ fixed TS defs.

* Fixes for query parameters, add samples.

* Add windows versions of redux-query scripts.

* Fix for form data handling.

* Initial work on multiple inheritance support.

* Tweaks for discriminator usage + from/to JSON.

* Fix initialization of queryParameters if needed.

* Copy over more QueryConfig values into the final generated QueryConfig.

* Fix for imports that are combined types.
2019-11-22 09:19:25 +01:00
William Cheng
5c275bccd2
Throw exception when config file missing (#4557)
* throw exception when config file missing

* fix bash config location
2019-11-22 14:01:57 +08:00
Bruno Coelho
80064d8411 [CI][Swift4] improve swift ci integration (#4571)
* [CI][swift] fix objcCompatible example

* [swift4] [ci] build openapi-generator and update swift4 samples
2019-11-22 11:06:47 +08:00
Bruno Coelho
51aeb6c833 [swift 4] improve test suite (#4561)
* [swift] improve testing in sample projects

* [swift] update run tests script

* [swift] regenerate samples

* [swift] fix tests with PromiseKit

* [swift4] compile every project with swift package manager
2019-11-21 22:40:49 +08:00
William Cheng
96bbab98a4 fix cpp-qt5-petstore.json location 2019-11-20 17:30:47 +08:00
Martin Delille
5238597f95 Use bin/cpp-qt5-petstore.json (#4547) 2019-11-20 09:47:18 +08:00
Jim Schubert
a0d68baa24
Validation script batches only samples (#4509)
* Validation script batches only samples

In this change, the validation script will batch only sample generation.
For meta and documentation, it will always be iterative.

Also made changes to meta-codegen*.sh so conditionals which may invoke
maven are explicitly rooted.

* [ci] batch python-experimental, include new springboot option
2019-11-17 19:35:38 -05:00
Erik Timmers
3cd0e13a46 [elm] Add support for oneOf (#4434)
And add additional test for composable types.
2019-11-17 09:18:26 +08:00
Jan
5181ddcbb0 fix: prevent ClassCastException when handling options of (issue #4468) (#4495)
* issue 4468 fix: prevent ClassCastException when handling options of type boolean

*  #4468 fix: remove duplicate code
2019-11-17 08:59:25 +08:00
Justin Black
a1a9e70fe4 Fixes Python client Configuration class so each instance uses its own dicts (#4485) 2019-11-17 08:49:19 +08:00
djairhogeuens
d9e93ce6ca feature: Typescript-angular support single request param (#4479)
* adds support for useSingleRequestParameter for typescript angular generator

* updates samples

* removes tab

* updates documentation

* removes tabs

* Revert "updates samples"

This reverts commit 8c5bfd94bdbd52187c1f38c43292dbba2cc483ef.

* updates samples

* adds configuration for sample generation

* fixes script

* sets executable flag

* fix docs
2019-11-14 10:51:37 +01:00
Jim Schubert
4a91e62fb7 [ci] Setting ensure-up-to-date to use batch option in CircleCI (#4445)
* [build] Enable --batch option in ensure-up-to-date

* [samples] Regenerate

* [ci] Use --batch in CircleCI script
2019-11-13 18:06:14 +08:00
Jim Schubert
bdd34a34e9 [ci] Removes elm from ensure-up-to-date (#4471)
bin/elm-petstore-all.sh invokes elm-petstore.sh and
elm-0.18-petstore.sh. Both of these define `ELM_POST_PROCESS_FILE` for
post-processing the generated files. If a user doesn't have elm-format
installed, they may not realize that ensure-up-to-date has failed which
causes CI to fail due to differences in the ELM generated outputs.

This confusion can lead to a lot of downtime for contributors. For
example, I encountered this while adding feature set information to all
generators. I thought I had introduced the error and spent too long
looking through my changeset and re-running `ensure-up-to-date`
in the background before noticing the failed output. I was able to
generate proper output by installing elm-format. With 80+ languages/frameworks
and a rule for contributors to unblock CI by re-generating any failed
samples, it's not feasible (in some cases, not possible) to ask
contributors to install tooling specific post-processors. We'll have to
rely on elm contributors to run the script manually.

Ideally, elm generator templates should be updated to have properly
formatted outputs as a default.

We may want to consider documenting standards of what we put in the
scripts under bin/*sh and bin/utils/ensure-up-to-date, one of those
standards being that we omit toolchain specific post-processors.
2019-11-13 13:39:10 +08:00
Alexander Eggers
34c715e4ce [Kotlin][Client] Add option to make all api method return a nullable model (#4422)
* Added new additional parameter to allow nullable api return types

* Tweaking samples and .bat files

I've added new .bat files for the kotlin-client to alllow windows-devs to re-generate required samples via windows-shell (for CI).
2019-11-12 22:15:54 -05:00
Jim Schubert
c663124ce3
Remove path relative to my home dir. (#4470) 2019-11-12 15:57:15 -05:00
Nick Meinhold
11bcb661a1 Dart generate keywords (#4449)
* Add script to use Dart SDK to generate keywords

* Read generated keywords in dart generator
2019-11-12 00:11:43 +08:00
William Cheng
84d3562a0f
[Kotlin][Client] minor improvements (#4419)
* minor improvement to kotlin generator

* minor code format change
2019-11-11 16:36:07 +08:00
Martin Delille
3e87a5fbaf cpp qt5 client: fix prefix bug (#4432) 2019-11-10 09:44:45 +01:00
Jim Schubert
357f6caed5
[meta] Support Kotlin meta generator (#4156)
* [meta] Support Kotlin meta generator

* Guard against automatic scripts (assumptions for this script are not fulfilled by some CI which run "run all" type scripts)
2019-11-09 10:47:55 -05:00
Bruno Coelho
7cf027fbf5 [kotlin][client] gson complete integration (#4332)
* [kotlin] update dependencies

* [kotlin][client] complete gson integration

* [kotlin][client] run petstores

* [kotlin][client] fix JsonMediaType and update petstores

* Add kotlin client gson to pom.xml

* Remove org.json dependency

* Try to fix kotlin-gson build

* Add kotlin client nonpublic to pom.xml

* Update samples

* try to fix build

* try to fix build

* try to fix build

* try to fix build

* [kotlin][client] restore libraries version

* [kotlin][client] update kotlin version

* [kotlin][client] update some libraries versions

* [kotlin][client] update some libraries versions

* [kotlin][client] add kotlin-gson and kotlin-nonpublic to CI test suit

* [kotlin][client] update some libraries versions

* try to fix build

* try to fix build
2019-11-08 15:02:48 +08:00
Jim Schubert
b536119162
[cli][script] Fix misspelling in cli bootstrapping script (#4356) 2019-11-03 16:47:22 -05:00
William Cheng
5dcde3f855
[Go][Server] better tests (#4295)
* better test for go-api-server

* better test for go gin server

* fix go-api-server test

* fix folder path

* remove red test

* update test files

* update script with gofmt

* update windows batch files

* discard changes before running ensure-up-to-date

* add go-api-server to ensure uptodate script
2019-10-29 15:15:24 +08:00
Justin Black
73c55c11dd [Python-experimental] types now classes, adds additionalProperties handling (#4154)
* Changes python-experimental types to classes, adds additionalalproperties handling

Adds model_utils update, updates model.mustache

Updates api.mustache and uses model_to_dict in model_normal.mustache

Updates requirements.mustache for PythonClientExperimental

Passes through check_type when deserializing models

Converts types from strings to classes in PythonClientExperimentalCodegen.java and PythonTest.java

Creates PythonClientExperimentalTest.java

Updates toInstantiationType to use ModelUtils.xxx

Corrects docstring descriptions of response_type

Updates python-experimental typing, partially fixes deserialization tests

Adds fixes for some of the deserialization tests

Fixes deserialization tests

Switches model teplates to use allVars so allof props will be included

Fixes tests.test_enum_arrays

Fixes test_to_str

Adds additional_properties_type, fixes teast_todict in test_map_test.py

Correctly check the type of _request_timeout values

Fixes test_upload_file test

Turns off coercion when instantiating model types with client data

Updates file handling to input and output an open file object

Fixes linting errors

Adds fixes for python2 tests, linting fixes

Adds additionalproperties to docs + tests

Regenerates python-experimatal client

* Regenerates python-experimental client

* Updates windows python-experimental bat file

* Fixes addModelImport so client generation will work with the v2 spec

* Reverts PythonClientCodegen.java

* Acutally revert PythonClientCodegen.java

* Updates the sample example for file_type in docs

* Silences line too long error for python models so CI tests pass

* Fixes handling of file uploads, adds tests for uploading files

* Removes comment

* Fixes mock installation in python2

* Limit mock addition to python-experimental test requirements only

* Removes SmartBear copyright line
2019-10-28 21:24:31 +08:00
lwlee2608
0f2272d9a4 Implement Server Stub Code for Vert.x Web #115 (#4286)
* InlineResolver to flatten callback operations

Signed-off-by: lwlee2608 <lwlee2608@gmail.com>

* clone from VertxServerCodegen, to new VertxWebServerCodegen

* fix compilation error in VertxWebCodegn

* Start working on VertxWebServerCodegen, adding support files

* add server api handler

* add server api and fix yaml spec file generation

* link api to apiHandler

* convert vertx parameters into API model

* add support to multipart/form-data upload files

* ability to set http status code from ApiImpl

* replace rootPackage with invokerPackage

* add readme and sample

* fix circleCi error

* override file to FileUpload in typeMapping, no need to override from fromOperation(). Also remove unused annotation import from model

* remove smartBear software copyright

* use {{artifactVersion}} instead of hardcode version in readme

* add -t flag in generation script

* add generated vertx-web server to master pom for testing
2019-10-28 14:08:21 +08:00
Yuriy Belenko
5a7b471511 Mark Slim3 server generator as deprecated (#4256)
* Mark Slim3 server generator as deprecated

* Add deprecated suffix
2019-10-26 15:49:30 +08:00
mrmeku
e85f6c577e typescript-angular: Allow for custom naming of ApiModule (#4209)
In cases where a user wants to generate multiple module's,
it is convenient to have these modules have different names.
2019-10-24 10:13:48 +02:00
Yuriy Belenko
8e78b14e28 New PHP Slim4 Server Generator (#3658)
* [Slim4] Copy Slim3 generator as starting point

* [Slim4] Add psr7Implementation generator option

Slim supports PSR-7 interfaces for its Request and Response objects.
Slim provides its own PSR-7 implementation so that it works out of the
box.
However, you are free to replace Slim’s default PSR-7 objects with
a third-party implementation.
[Ref] https://www.slimframework.com/docs/v4/concepts/value-objects.html

* [Slim4] Handle psr7Implementation generator option

It somehow ended up with composerPackages and composerDevPackages
codegen variables and two additional functions. Hope, it's not too much.

* [Slim4] Extend from Slim3 generator

* [Slim4] Bump PHP Slim Framework version to 4.0.0

* [Slim4] Bump required PHP version to 7.1

[Upgrade Guide](https://www.slimframework.com/docs/v4/start/upgrade.html)

* [Slim4] Remove app settings

Slim’s App settings used to be a part of the container and  they have
now been decoupled from it.

[Upgrade Guide](https://www.slimframework.com/docs/v4/start/upgrade.html)

* [Slim4] Set container argument optional

Slim uses an optional dependency container to prepare, manage,
and inject application dependencies.
Slim supports containers that implement PSR-11
like [PHP-DI](http://php-di.org/doc/frameworks/slim.html).

[Upgrade Guide](https://www.slimframework.com/docs/v4/start/upgrade.html)

* [Slim4] Change response body write

You can't write to response instance directly anymore,
need to retrieve body object first.

[Doc](https://www.slimframework.com/docs/v4/objects/response.html#the-response-body)

* [Slim4] Change Slim\App constructor

[Upgrade Guide](https://www.slimframework.com/docs/v4/start/upgrade.html)

* [Slim4] Refactor token authentication options

User can provide array or Container as constructor argument from now.
Small refactoring required to retrieve authentication options from
that argument.

* [Slim4] Add PSR-7 implementation codegen flags

This approach seems more flexible to me.
User can customize templates in favor of chosen PSR7 implementation.
It's easier to change Composer packages and their versions.

* [Slim4] Add JsonBodyParserMiddleware

Slim4 doesn't parse JSON body, need to add suggested middleware.
Ref: https://www.slimframework.com/docs/v4/objects/request.html#the-request-body

* [Slim4] Remove request's deprecated methods usage

Since Slim 4.0.0 ServerRequest implementation doesn't have
getQueryParam and getParsedBodyParam methods anymore.

* [Slim4] Use getUploadedFiles for multipart request

isMultipart codegen property is always false so far.
Hope that bug will be fixed soon.

* [Slim4] Add samples
2019-10-21 22:20:12 +08:00
Jan Jongboom
1052ebaced typescript-jquery: Update to work with Typescript strict mode (#3969)
* typescript-jquery: Work in Typescript strict mode

* re-generate samples
2019-10-21 13:44:48 +02:00
William Cheng
9eb3c4fa7a
Add Petstore samples for dart-dio (#4162)
* Add samples for dart-dio

* use dartmft
2019-10-17 11:15:17 +08:00
Jim Schubert
0e1ce6bb63
[docs] Custom template clarifications and other minor enhancements (#4167)
* [docs] Updating docsite outputs to be browsable on Github as well

* Fix links to other files
   Suffix `.md` was needed to make links works

* [docs] Add clarification to differences between customization and templating docs

* [docs] Collapsible side bar, scroll to top, minor enhancements
2019-10-16 18:04:44 -04:00
William Cheng
672a7e9c60 update samples 2019-10-16 02:52:04 +08:00
Josh Burton
755a6f4445 Adds Dart Dio generator (#4018)
* Adds initial implemenation of dart-dio generator

* Adds remaining boilerplate for dart-dio generator
2019-10-15 21:05:38 +08:00
Bruno Coelho
3cd74f4a8d [kotlin] add option for non public api (#4089)
* [kotlin] add option for non public api

* [kotlin] update petstores

* [kotlin] add missing script to kotlin-client-all.sh

* [kotlin] update pet projects

* [kotlin] remove public modifier

* [kotlin-client] inline visibility modifier
2019-10-10 21:56:40 +08:00
William Cheng
b69b8cdd31
[Kotlin][Client] fix missing curly bracket when the model contains enum property (#4118)
* fix kotlin okhttp3, add CI test

* update kotlin server sample
2019-10-10 18:21:50 +08:00