9299 Commits

Author SHA1 Message Date
William Cheng
c379f5bcc4
encode URL parameters (#9688) 2021-06-08 10:02:33 +08:00
William Cheng
37b7c80c4f
null check on $ContentTypes (#9687) 2021-06-08 09:09:21 +08:00
Georgy Ushakov
64ee3fe207
Added support for async accessToken in typescript-fetch (#9659) 2021-06-07 22:15:01 +02:00
Nikita Vakula
599a2ca477
Add validators to models fields (#9668)
* [python-fastapi] Apply constraints to models

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>

* [python-fastapi] Use pydantic types to validate models fields

Some data formats can be validated by annotating fields with some
special pydantic data types (EmailStr, forr example).

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>

* [python-fastapi] Updated samples

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
2021-06-07 12:00:04 +08:00
William Cheng
088bca1580
[python][fastapi] various minor improvements (#9672)
* fix python fastapi tests, update readme, add CI test

* update FILES

* use virtualenv

* fix pom.xml

* skip flake8
2021-06-07 11:55:26 +08:00
Peter Leibiger
fdbf02764d
[dart][dart-dio] Add support for query collection parameter format (#9635)
* [dart][dart-dio] Add support for query collection parameter format

* add support for collectionFormat in query parameters and www-url-encoded content
* add tests
* remove empty query parameter maps from generated code
* closes #6681
* closes #9522
* closes #8271 (the last remaining parts)

* Fix formatting
2021-06-07 09:49:59 +08:00
Ayman Bagabas
f923a0ef15
Swift5 Vapor 4 client library (#9625)
* [swift5] Add Vapor client library

* Try to improve overall spacing (#17)

* [swift5] try to remove changes in model and api

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* Update samples

* [swift5] vapor: return clientResponse when no default case

* Update samples

Co-authored-by: Bruno Coelho <4brunu@users.noreply.github.com>
2021-06-06 22:08:14 +08:00
Nikita Vakula
93880a486e
python-fastapi improvements (#9649)
* [python-fastapi] Ignore some flake8 warnings

1. Some of the "imported but not used" warnings are there because
it is not easy to express what should be imported in mustache template
language. These warnings are silenced in order to keep the templates
morre readable.
2. Single quotes -> Double quotes (for consistency).

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>

* [python-fastapi] Added flake8 config

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>

* [python-fastapi] Set extra constraints on values

It is important to set all constraints (pattern, greater than, etc.)
on values of all arguments, because FastAPI can handle them automatically.

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>

* [python-fastapi] Updated samples

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
2021-06-03 10:13:24 +08:00
William Cheng
f0bbeb75ff update erlang-server samples 2021-06-03 09:52:05 +08:00
Bruno Coelho
0f51662650
[kotlin][client] small improvements (#9640)
* [kotlin][client] standardize adapter type names

* [kotlin][client] remove unused class

* [kotlin][client] fix IDE warning

* [kotlin][client] improve import layout

* [kotlin][client] update sample projects
2021-06-02 11:07:26 +08:00
Ayman Bagabas
9bce71656c
Swift5 namespace changes (#9624)
* [swift5] Rename the API class to {{projectName}}

Instead of {{projectName}}API. This removes some unnecessary naming
complexity.

* [swift5] Define models and Configuration classes under namespace

When swiftUseApiNamespace is set, API classes get defined under the
projectName namespace. This does the same for models and the
Configuration class. Plus adding a deprecation warning when using the
un-namespaced variants.

* [swift5] Use CodingKeys in model decoder

Fixes: 0f5e7d1e3cb9 ("Swift5 models improvements (#9205)")

* [swift5] Add swiftUseApiNamespace to urlsessionLibrary config

* Update samples

* Try to reduce model changes

Co-authored-by: Bruno Coelho <4brunu@gmail.com>
2021-06-02 00:45:01 +08:00
Bruno Coelho
463ae10c4a
[kotlin][client] update dependencies (#9629)
* [kotlin][client] update dependencies

* [kotlin][client] update sample projects

* [kotlin][client] fix update dependencies
2021-06-01 10:09:48 +08:00
Bruno Coelho
6cf4843249
[swift5][client] update dependencies (#9633)
* [swift5][client] update dependencies

* [swift5][client] update sample projects

* [swift5][client] update dependencies in Carthage
2021-06-01 10:09:22 +08:00
Sascha Peilicke
173a349e04
Kotlin: Fix kotlinx_serialization code generation (#9576)
And update to Kotlin 1.5.0 and kotlinx.serialization 1.2.1. Fix nested
enum annotation '@Serializable' instead of '@KSerializable' when
'kotlinx_serialization' is used. Fix missing JsonMediaType in
ApiClient.kt (#9242). Add 'kotlinx_serialization' serialization library
to documentation. Use explicity type in RequestConfig to keep type
information for JSON serialization.

Resolves #9242
2021-05-31 21:48:39 +08:00
William Cheng
32a045060e
[ python-fastapi] minor improvements (#9622)
* minor python-fastapi improvements

* update doc

* fix refreshUrl
2021-05-31 17:00:23 +08:00
Peter Leibiger
afd65b3cb0
Update query parameter sample to include pipe delimiter (#9590) 2021-05-30 17:45:38 +08:00
Nikita Vakula
0da4099868
New python-fastapi generator (#9611)
* [python-fastapi] Added new generator

See https://fastapi.tiangolo.com/ for more details about FastAPI

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>

* [python-fastapi] Added samples

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
2021-05-30 17:43:31 +08:00
Bruno Coelho
dee2840b20
[swift5][client] improve docs for Data (#9605) 2021-05-30 17:40:09 +08:00
Peter Leibiger
f7b93ebdf2
Update fake API to contain sample with binary body (#9610) 2021-05-29 10:26:01 +08:00
Stefan Hanselmann
1b6fd2dd7a
[Kotlin][retrofit2] replace okhttpclient with callfactory (#9451)
* [Kotlin][Retrofit][#9448] Replace OkHttpClient parameter with Call.Factory.

* [Kotlin][Retrofit][#9448] Update sample project.
2021-05-28 21:50:28 +08:00
William Cheng
763f65f293
[Wsdl] minor improvements, bug fixes (#9613)
* minor improvements to wsdl-schema gen

* better code format

* update readme
2021-05-28 21:38:36 +08:00
William Cheng
28c3e1d544 update samples, docs 2021-05-28 10:26:48 +08:00
adessoDpd
12c34d4658
New generator: WSDL (#9545)
* init port

* add outputDir

* fill out current .md

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-05-28 10:22:28 +08:00
adameste
73b34ade6a
[cpp-restsdk] Update json double/float parse. (#9577)
* [cpp-restsdk] Update json double/float parse.

Fix cpp-restsdk double and float parse.

double.NaN was parsed when server doesn't ensure the floating point value has decimal point in in.

* Update docs & samples.
2021-05-28 09:58:01 +08:00
William Cheng
670c5884b6 update samples 2021-05-27 11:23:00 +08:00
Peter Leibiger
6edbc91eeb
[dart][dart-dio] Update docs for dart-dio-next (#9584)
* remove deprecated author field from all pubspec templates
* improve dart-dio-next readme/markdown documentation
* add a lot of dart-doc to model and API classes
2021-05-27 10:58:37 +08:00
Elan Thangamani
62a52bf1e8
Upgrade Virtualan version with 2.2.1 -> Open API Mock service (#9598)
* changed correct values

* Updated virtualan version

* updated the correct version

* Updated with latest version

* Update pom.xml

* Updated with 2.5.0

* Updated with db 2.5.0 version
2021-05-27 10:46:22 +08:00
William Cheng
32d5900611 update samples, docs 2021-05-27 10:40:32 +08:00
desmese
4f1d8f4699
- added localVar prefix to the contentType variable defined in the api.mustache template in the java resttemplate library (#9568)
- rerun generate-samples.sh and export_docs_generators.sh
2021-05-27 10:24:38 +08:00
Bruno Coelho
a61db6e596
[swift5][client] fix binary response (#9595)
* [swift5][client] fix binary respose

* [swift5][client] fix binary respose
2021-05-27 10:18:51 +08:00
Justin Black
6e6b8472d4
Adds isShort + isUnboundedInteger to IJsonSchemaValidationProperties implementers (#9519)
* Adds getter + setter methods for isShortInteger in IJsonSchemaValidationProperties

* Adds isShortInteger to CodegenModel

* Adds isShortInteger to CodegenProperty

* Adds isShortInteger to CodegenParameter

* Adds isShortInteger to CodegenResponse

* Ensures that samples are up to date

* Changes interface to isShort

* Removes typescript file

* Adds isShort to CodegenModel and CodegenProperty instances

* Samples updated, shows too many changes across generators

* Adds isUnboundedInteger and implements it in CodegenModel

* Adds isUnboundedInteger to COdegenProperty

* Adds isUnboundedInteger to CodegenParameter

* Adds isUnboundedInteger to CodegenResponse

* Regenerates samples and docs

* Adds testBooleansSetForIntSchemas

* Fixes integer tests
2021-05-26 11:59:28 -07:00
Bruno Coelho
163d13e415
[kotlin][client] fix Android crash on API level 25 and bellow (#9578)
* [kotlin][client] fix Android crash on API level

* [kotlin][client] update sample project

* Try to fix CI

* [kotlin][client] add flag to control android api level supported

* [kotlin][client] update docs

* [kotlin][client] update docs
2021-05-26 18:24:52 +08:00
Blackclaws
e09409fbce
Handle Deserialization Asynchronously (#9424) 2021-05-26 00:12:12 +08:00
Peter Leibiger
ab11acd634
[dart][dart-dio-next] Improve support for file uploads (#9542)
* [dart][dart-dio] Improve support for file uploads

* add support for filenames in multipart requests by using  `MultipartFile` from dio directly
* add support for binary/file body data
* fixes #6671
* fixes #9079

* Add and fix tests

* Only use MultipartFile for body/multipart parameters

* Fix test

* Actually fix tests
2021-05-25 23:58:39 +08:00
William Cheng
ae430a8c14
[cpp][tiny] rename generator, update samples (#9560)
* rename generator, update samples

* add doc

* update readme
2021-05-25 23:55:16 +08:00
Alexandre
6c40192706
[swift5] Add support for oneOfs (#8714)
* [swift5] Add support for oneOfs

* Generate a sample Swift project with oneOfs

* Update Swift Samples
2021-05-24 13:01:16 +08:00
Anders Aaen Springborg
4e48dae8e4
New generator | Arduino cpp (#9489)
* initil tiny client generator

* Helper string

* WIP: added helper file with json helper functions

* WIP: model implementation.. Working on JSON

* Added codegen files for model and helper

* WIP: toJson()

* Added mapping configurations

* Upadet string compare

* Removed redundant namespaces

* Added files for example

* fixed syntax errors

* fixed syntax errors

* header generation

* unittest example for pet class

* Refactored mustache & fixed logical errors

* WIP: unit test mustache format

* Removed legacy file

* mustache service

* Declare service in Java file

* Removed legacy file

* removed legacy code

* Documentation

* Added folder structure + new supporting files

* Added file to run all unittests

* Refactored unit tests

* typemappings and new paths

* First service impl

* Added esp32 and esp8266 env

* Added default values

* Added cli option to specify controller

* added type decl method

* Added stringify methods

* service get requests

* Fix helper header

* post merge fix

* fix long test

* Tiny namespace

* remove shared pointer

* include petapi

* stringify

* return problems

* Canged logic for response-body handling

* Implemented last logic for reponse handeling

* Implemented constructor logic

* first tiny sample

* update basepath to petstore v3

* standard main example

* root certificate example

* root folder

* TODO cleanup

* exclude features

* supports delete again!👷

* remove todo 

* new main example ❣️

* new main example ❣️

* Make our feature set realistic

* fix indentation

* HTTP / HTTPS Connection

* Root certificate sample

* https vs http 👨🏻‍🔬

* fix lint in template

* default value for controller in config

* new readme 📜

* remove old comments

* removed unused testfile

* no default root certificate

* new main

* remove test

* Update platformio.ini.mustache

🤷‍♂️

* Update platformio.ini.mustache

remove native

* added support info

* Add namespace to Pet 🐅

* bourne compatibility fix

* spelling error in python file

* bourne python script 🐍

* Version bump

* Add bourne script to readme

* update main sample, from template

* pre_compiling_bourne.py.mustache to samples folder 📃

* set header Content'type to json

* map todo🗺️

* remove unused debug flag⚒️

* added support for ESP8266 ༼ つ ◕_◕ ༽つ

* added new sample for ESP32 📀

* 🎯

* removed use of namespace std 

* removed use of "__" in variables

* removed unused code in destructor

* fixed type comparison

* move default ctor to header

* added zero initialized primitive variables

* moved variable to TypeMappings

* updated ifndefines

* Extra comment for build error in standard example 🦸🏽‍

* afer cpp-ish cast from std::string to uint8* cast🏰

* excluded maps type

* Documentation og generator

Co-authored-by: kaareHH <kaare.hattel@gmail.com>
Co-authored-by: mkakbas <45030188+mkakbas@users.noreply.github.com>
Co-authored-by: mkakbas <martinkandersen1@gmail.com>
2021-05-24 11:11:44 +08:00
alespour
e360228a76
fix: dart2 mustache templates minor improvements (#9539)
* fix: prefer_is_not_empty linter suggestion

* fix: annotate_overrides linter suggestion

* chore: update samples
2021-05-24 11:01:53 +08:00
Peter Leibiger
be84c44fcc
[dart][dart-dio-next] Add stacktraces to manual DioError instances (#9549) 2021-05-24 10:54:51 +08:00
Peter Leibiger
48924eb1a0
[dart] Improve content-type handling (#9517)
* [dart] Improve content-type handling

* fixes #9334
* superseeds #9454
* use `prioritizedContentTypes` in the same way `JavaClientCodegen` does
* move `application/json` to the front if it exists
* don't do anything if it is multi-part or url-encoded as for this the first content-type already needs to match
* log warning if an unsupported content-type is first after prioritizing
* remove some unused code blocks from dio generators

* Only use first prioritized content-type in dio generators

* don't default to any content-type in dio-next, dio defaults itself to JSON
2021-05-24 10:53:39 +08:00
agilob
b1cba96627
Revert "[Java][Spring] Fix for #8659 - Different in-parameter types generated for api and delegate for files (#9331)" (#9555)
This reverts commit b9a1c8f016711307b9c718dbbdf60a137372c7af.
2021-05-23 22:59:51 +08:00
Rinish Sam
9eb9c30a92
[dart][dart-dio] Fix gitignore comment style (#9554)
* Fix gitignore comment style in templates

* Update samples
2021-05-23 11:27:07 +08:00
Blackclaws
696bcb3e85
[csharp][httpclient] Remove noncompliant post behaviour (#9427)
* Remove behaviour that does not 1:1 represent spec

* Update samples
2021-05-21 14:50:42 +08:00
Blackclaws
2c4e79f45c
[csharp][httpclient] Introduce FileParameter as an abstraction (#9426)
* Introduce FileParameter as an abstraction

* Update Samples

* Add new file to samples

* Fix hardcoded package name

* Fix hardcoded package name, import FileParameter in Model

* Remove unneccesary warning
2021-05-21 14:49:33 +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
071dc3413d
fix typescript node due to @types/bluebird 3.5.35 (#9533) 2021-05-21 14:45:14 +08:00
Arthur Mogliev
ab6d66147b
[php-mezzio-ph] PHP 8 support (#9445)
* Huge update for php-mezzio-ph generator:
- proper container support for data types
- support for query parameter references and query parameter schema references
- dependency update (PHP 7.3+, PathHandler 0.7+, DataTransfer 0.5+)

* Sample regeneration after rebasing for php-mezzio-ph

* - added custom CLI option for php-mezzio-ph to generate code using modern PHP syntax
- removed obsolete php-mezzio-ph samples in samples/openapi3/server/petstore/php-mezzio-ph

* - fixes for JavaDoc declarations that seems to break CI

* - fix for outdated sample file
2021-05-21 14:40:38 +08:00
William Cheng
4948ce78ed update samples 2021-05-21 12:54:40 +08:00
Yusuke Hosonuma
338812114c
[crystal][client] support configure method with block (#9506)
* [crystal][client] allow initialize Configuration with block

* [crystal][client] update samples

* [crystal][client] add test for configuration.cr

* [crystal][client] fix .configure

* [crystal][client] update samples

* [crystal][client] add test for pestore.cr

* [crystal][client] fix Configuration#configure
2021-05-21 12:37:21 +08:00
Stefan Hanselmann
d1b8a3fac4
[Kotlin] [#8809] Allow optional header parameters with Kotlin and ret… (#9306)
* [Kotlin] [#8809] Allow optional header parameters with Kotlin and retrofit2

* [Kotlin] [#8809] Update sample client

* [Kotlin] [#8809] Replace mustache dot notation with more classic style

* [Kotlin] [#8809] Remove new line at the end of the mustache template
2021-05-20 23:07:04 +08:00