9299 Commits

Author SHA1 Message Date
William Cheng
b23c52f2ca
[Go][experimental] provide code samples in the API doc (#6115)
* provide code samples in api doc

* update petstore samples
2020-05-01 10:50:01 +08:00
Artem
0032e04530
[php-symfony] Fix return type in model setters. (#6085)
* Fix return type in model setters.
Previously return type was same, as method arguments. It`s wrong, and cause errors like
"Return value of Foo::setSuccess() must be of the type bool, object returned"
We cant use self and current {{classname}} as return type, because that can break class inheritance. So, better remove type hint on setters, until PHP-devs dont make realization for return static

* Add return self type hint for setters

* Revert "Add return self type hint for setters"

This reverts commit 07dd9715
2020-04-30 22:03:05 +03:00
William Cheng
3bbaedd9bc
Better "Any Type" support (#6091)
* better anytype support

* add tests for any type

* fix test with any_value

* fix tests

* fix case additionalProperties: {}

* test with CI

* remove check in map schema

* Revert "remove check in map schema"

This reverts commit e016c4155f1bd8753e894d87bad8e70eee29f3d5.

* fix tests, comment out map schema fix

* fix tests

* fix tests with correct codegen model

* fix tests

* fix tests for map of any type

* fix array of any type

* fix array of any type

* update samples, remove log

* add typemapping to go, python
2020-04-30 21:23:55 +08:00
Artem
3e2c933dec
[php-symfony] Fix problem with clients, that put charset in content type header. (#6078)
* Fix problem with clients, that put charset in content type header.

With this fix header "Content-Type: application/json; charset=utf-8" working same as "Content-Type: application/json" for parse input data

* Fix code style, add $consumes length check.

* Add isContentTypeAllowed static method and tests

* Fix old tests

Right now serializer doesn't support anything beside json and xml.
Call tests with application/json instead of form data.

Co-authored-by: Yuriy Belenko <yura-bely@mail.ru>
2020-04-30 12:22:44 +03:00
Aleksandr Nekrasov
8e4452e383
[scala-akka-http] fixed getOffsetDateTimeHeader and removed broken test due invalid v2 spec (#6109) 2020-04-30 10:53:14 +08:00
William Cheng
001d9cb36d
better docstring for jersey2 client (#6104) 2020-04-29 23:43:21 +08:00
Geoff Brown
bc097cfdde
[C#] Fixed valuetype parameters and discriminator deserialization (#5680)
* Fixed valuetype parameters and discriminator deserialization

- Made non-required valuetypes nullable, and flagged required valuetypes as "x-csharp-value-type"
- Made sure to camelCase discriminator property names in Subtype converter

* Ran pet store sample script

* Ensure that readWriteVars and readOnlyVars are also marked as isEnum and isPrimitiveType where appropriate

* Updated petstore sample with enum fix

* Fields that are required should emit default values (otherwise the consuming API might throw a fit

* Added missing sample updated

* Re-ran petstore example script to grab all changes

* Rebased and re-ran example update script

* update csharp samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-04-29 21:36:27 +08:00
William Cheng
a8885e838a
update swift5 samples (#6102) 2020-04-29 18:03:19 +08:00
iliaskarim
e01c1a9b72
Readonly properties for Swift 5 (#6048)
* Generate readonly properties in Swift5 with additional readonlyProperties parameter

* add sample
2020-04-29 11:17:00 +08:00
Dennis Ameling
7424582210
[TypeScript-Angular] Add AuthService example to README.md (#6087)
* Add AuthService example to TypeScript Angular README.md

* Update generated Angular libs
2020-04-28 17:13:41 +02:00
Harald Fernengel
500fb472b0
[typescript-fetch] Allow multiline documentation (#6088)
Add a lambda that formats the documentation correctly even if it
contains newlines. The generated docs with typedoc looks a lot better
and also renders Markdown correctly.

Also remove the "no description" fallback for APIs because we don't have
it anywhere else, other generators don't generate a default fallback and
I'd rather have no documentation than a "no description" string.
2020-04-28 16:20:26 +02:00
Harald Fernengel
6f9d8259b0
[typescript-fetch] Make FormData optional (#6077)
Check "typeof FormData" first. This allows the code to also work in
nodejs with isomorphic-fetch.
2020-04-28 15:21:53 +02:00
William Cheng
46216cd796 Merge remote-tracking branch 'origin/master' into 5.0.x 2020-04-28 20:35:28 +08:00
jerbob92
3d5b140c3d
Fix URLSessionImplementations file upload (#6043)
* Fix URLSessionImplementations file upload

* Generated petstore
2020-04-28 00:28:21 +08:00
William Cheng
588023686a
Add HTTP signature authentication support to Java (jersey2-experimental) (#6058)
* add fmt-maven-plugin to jersey2 exp

* update samples

* add http signature auth template

* minor fix

* fix http beaer auth, update sample

* fix http signature auth

* fix http signature auth

* header support

* add query string to path

* undo changes in default codegen

* ignore fake test

* add serialize to string method

* add serialzie to string method

* add get mapper

* auto format java source code

* remove plugin

* update pom.xml

* change back AbstractOpenApiSchema to T

* skip mvn code formatter in bin script

* undo changes to spec

* update samples

* add back HttpSignatureAuth.java
2020-04-28 00:09:30 +08:00
William Cheng
3b0bd368a6
Update Java (feign) client dependency (#6068)
* update feign dependency

* update feign samples
2020-04-28 00:09:14 +08:00
Justin Niessner
db5941379f
[Python] Fix Python UTF-8 Encoding Issue (#5679)
* Try decoding but don't bail on error

* Switch binary and ByteArray to bytes

* Read content type and parse appropriately

* Remove response parsing

* Remove response parsing and just return the data

* Update petshop examples w/ new generator code

* Fix copy/paste error with naming

* Update petstore examples

* Move response decoding to inside _preload_content block

* Update the clients again

* Use a raw string for the regex pattern

* Regenerate petstore clients

* Add bytes to python primitives as it's supported in 2.7 and 3

* Add bytes to the exports from model_utils

* Import bytes from model_utils

* Add conditional typing for regex pattern to match variable type

* Regenerate petstore clients

* Use read() instead of text() for asyncio

* Regenerate petstore clients

* Remove unused six import

* Regenerate petstore clients

* Add newline to kick Circle to re-run

* Remove whitespace from tox.ini

* Update more examples after ensure_updated

* Add sample updates that didn't run with the --batch flag

* Remove extra bracket in regex to remove warning

* Stop printing debug messages

* Add bytes examples to python doc generators

* Update generated FakeApi docs

* Regenerate api_client.py

* Remove print statements from generated clients

* Update bytes example in FakeApi.md. Again. I swear.

* Add yet another seemingly missing doc update

* Catch the error, decode the body, and re-throw

* Remove the updates now that the change is non-breaking

* Regenerate client

* Add bytes deserialization test

* Update exception parsing

* Add exception parsing for python-experimental

* Regenerate client with minor changes

* Revert test changes

* Regenerate model_utils.py

* Update confusing test name

* Remove bytes from mapping and examples

* Add back in the old binary/ByteArray to str mapping

* Update docs and api_client template

* Add experimental api_client changes

* Regenerate samples again

* Add Tornado handling to early return

* Try fixing Tornado python returns

* More documentation changes

* Re-generate the client code

* Remove bytes from test_format_test

* Remove more leftover bytes usages

* Switch bytes validation back to string

* Fix format_test template and regenerate

* Remove unused bytes var

* Remove bytes import from models and regenerate

* Remove bytes import from test_deserialization

* Reduce nested ifs

* Remove byte logic for now

* Regenerate client after latest changes

* Remove another bytes usage

* Regenerate after removing dangling byte string usage

* Reduce the scope of the try/catch in api_client

* Regenerate after try/catch cleanup

* Swap catch for except

* Regenerate Python client after api_client change

* Fix lint error on the generated api_client

* Add binary format test back in w/ string

* Add decoding to python-experimental and regenerate

* Import re into python-experimental api_client

* Ensure file upload json response is utf-8 encoded bytes
2020-04-26 13:33:42 -07:00
Richard Whitehouse
f36a319316
[Rust Server] Rust 2018 Edition (#5942)
* [Rust Server] Rust 2018 Edition
* [Rust Server] Fix unused warning
* Update samples
2020-04-26 12:00:46 +01:00
William Cheng
cef5470ea8
Add Http signature authentication test to fake petstore spec (#6054)
* add endpoint to test http signature

* update plugin version
2020-04-25 23:39:41 +08:00
Sebastien Rosset
e8f486ba7f
[Python experimental] Readme improvements (#6031)
* Python experimental readme improvements

* Python experimental readme improvements

* execute scripts in bin directory
2020-04-25 00:10:32 +08:00
Justin Black
8e8471c1fd
[CORE] Fixes composed schema discriminator map (#4906)
* Adds addComposedMappedModels and testComposedSchemaOneOfDiscriminatorMap

* Requires that discriminators be required properties

* Strengthens discriminaotr validation, adds better error messages, adds schema oneof samples

* Adds oneOf and anyOf invalidDiscriminator tests

* Updates incorrect addOneOfInterfaceModel invocation

* Runs ensure-up-to-date

* Adds updates from Sebastien Rosset

* Removes newlines

* Uses df.isString

* Fixes tests be correctly setting df.isString

* Updates discriminatorExplicitMappingVerbose description per PR feedback

* Adds description of how mappedModels is populated

* Adds the suggestion exception raising when a MappedModel mappingName is null

* Actually resolves merge conflicts

* Switches two methods to package private because they are needed for testing

* Allow nulls in MappedModel.getMappingName

* Updates CLI flag name to legacyDiscriminatorBehavior, default=true

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-04-25 00:01:02 +08:00
sunn
234053fed9
Export response code to worker (#6021) 2020-04-24 14:46:25 +02:00
sunn
649daed9a9
Export valid and set status of properties (#6020) 2020-04-24 14:44:48 +02:00
Sebastien Rosset
6ad5e5fb45
[Python experimental] Add __setattr__ function to ensure signing_info.host is the same as configuration.host when the user assigns signing info (#6033)
* Add __setattr__ function to ensure signing_info.host is the same as configuration.host when the user assigns signing info

* Add __setattr__ function to ensure signing_info.host is the same as configuration.host when the user assigns signing info
2020-04-23 23:16:31 -07:00
Sebastien Rosset
1e01c380e8
[python-experimental] Minor doc update, code comments and exception handling (#5945)
* add support for any type, i.e. when 'type' attribute is not specified in OAS schema

* fix typos, add code comments

* Handle case when 'type' attribute is not present in the OAS schema

* fix python formatting rule

* fix python formatting rule

* remove 'object' as a type
2020-04-23 22:59:31 -07:00
William Cheng
93dd4a5138
Add jersey2-experimental to Java client generator (#6024)
* add jersey2 experimental

* add new files

* add abstract one of class

* read the stream multiple times

* rename to getActualInstance

* update petstore

* fix jackon check

* test new java petstore in ci

* fix broken tests

* remove todo

* better exception message, primitive type handling

* add anyof support

* update samples

* add new files

* update all java client samples

* update doc, fix pom

* better null check for allOf

* add primitive types support in oneof, anyof

* better validation

* update python exp samples

* remove primitive type support in allOf
2020-04-24 12:47:25 +08:00
Andy.Yang.cn
d911fd73bd
[Rust Server] Bugfix #5948 (Generated client code "Disabled because there's no example") (#5949)
* [Rust Server] Fix RustServerCodegen type: object example "Disabled because there's no example" issue.

* [Rust Server] Add test case yaml with "Disabled because there's no example" issue.

* [Rust Server] Fix example-client-main param.example character escaping issue with raw string.

* [Rust Server] Add test case yaml new generated code after fix.
2020-04-24 11:04:36 +08:00
iliaskarim
bafed337b5
Fix OpenAPI link in broken Swift4/5 README templates (#6035)
* Fix Swift README templates

* Update Swift4/5 samples
2020-04-24 10:36:52 +08:00
William Cheng
4ed3421a77 update resttemplate sample 2020-04-23 23:32:47 +08:00
Andy.Yang.cn
38dfed4104
[Rust Server] Fix #5947 multi tag generate multi method issue. (#5928)
* [Rust Server] Fix issue with multiple tags on an operation generating duplicate methods.

* [Rust Server] Add test case yaml with multiple tags on a single operation.
2020-04-22 18:00:21 +01:00
William Cheng
46b0421fa5 update java restassured jackson 2020-04-22 15:36:31 +08:00
William Cheng
02717e6076 update samples 2020-04-22 14:48:27 +08:00
William Cheng
47a9294a99 Merge remote-tracking branch 'origin/master' into 5.0.x-sync-master4 2020-04-22 12:15:45 +08:00
Jochen Schalanda
40be1c311e
[Java][Client] Fix Gradle and SBT builds for REST Assured generator (#5990)
* Fix Gradle and SBT builds for Java REST Assured generator

* Add missing jackson-databind-nullable dependency to SBT build

* Update rest-assured sample

* Add sample for Java client with REST Assured and Jackson

* Add new REST Assured sample as Maven sub-module
2020-04-22 11:19:17 +08:00
William Cheng
5ae783aac5 update jaxrs cxf samples 2020-04-22 10:58:31 +08:00
William Cheng
ac5de91b97 update jaxrs cxf version 2020-04-22 00:17:58 +08:00
Harald Fernengel
381ebeb33e
[typescript-fetch] support http HEAD as well (#5994)
closes #2935
2020-04-21 14:12:11 +02:00
William Cheng
bf4c5298fd fix port in sample 2020-04-21 18:13:21 +08:00
William Cheng
98ea048d46 fix port in pom.xml 2020-04-21 15:59:39 +08:00
Yuriy Belenko
da149e1204
[mysql] Add OAuth2 framework tables (#5807)
* Add OAuth table schemas

* Refresh samples

* Expand password column length

* Add copyright notice of OAuth2 schema author

* Refresh samples
2020-04-21 14:25:56 +08:00
William Cheng
f80a5b3e64 update meta codegen 2020-04-21 14:03:45 +08:00
William Cheng
0f8b0edfad fix dart openapi-generator version 2020-04-21 10:09:42 +08:00
William Cheng
fc7dda8db9 update more samples 2020-04-21 10:04:42 +08:00
William Cheng
5a9b0fcf9e update samples 2020-04-21 02:22:55 +08:00
Richard Whitehouse
2cd5bc45da Update samples 2020-04-20 18:43:19 +01:00
Justin Black
1766279916
Fixes issue 5876 (#5977)
* Fixes getParentName function

* Updates getChildrenMap to not throw a NPE

* Updates test

* Runs ensure up to date
2020-04-20 16:00:24 +08:00
Malcolm Murray
4818644278
[BUG] [TYPESCRIPT-AXIOS] Fixing issue where dist folder is not published when publishing typescript-axios generated client with npm publish (#5850)
* Removing build path from gitignore as this causes npm publishing issues

* updating petstore example

* Adding npmignore to typescript-axios generator

* Updating petstore example
2020-04-20 11:27:53 +08:00
William Cheng
c6353a7589
add bearer auth support to C# 2.0 client (#5978) 2020-04-19 23:15:57 +08:00
zaleski.d
f6572fd2f4
[bug][html2] Fix visibility of body/response schemas (#5643)
* 1441 fix visibility of body/response schemas

* Handle schemas with array items

* Point to template directory in bin script

* Regenerate sample

Co-authored-by: Jim Schubert <james.schubert@gmail.com>
2020-04-19 09:38:28 -04:00
William Cheng
171f71872e
add test to reuse object from the server (#5976) 2020-04-19 12:37:48 +08:00