1199 Commits

Author SHA1 Message Date
Jim Schubert
49760f7a34
[sonar][ci] Fixes some new recommended "bug" fixes found via Sonar (#7508) 2020-09-24 22:02:11 -04:00
William Cheng
596bbb9c58
Add option to set recursion limit (#7491)
* add option to set recursion limit

* fix test failure

* update doc

* add tests

* add missing import

* rename option to recursionLimit
2020-09-24 11:47:22 -07:00
Jiri Kuncar
bc799b2488
[ruby] Support for per-operation servers (#7415)
* Support server configuration per operation

* regenerated+tests

* base_url fix

* support not templated urls

* revert update of ruby docs
2020-09-24 11:21:43 -04:00
William Cheng
8c78f13a41
remove hardcoded PetApi (#7483) 2020-09-22 11:45:29 -07:00
Jim Schubert
a29d9a9ff4 [samples] Regenerate 2020-09-20 23:27:48 -04:00
spacether
35d42728d9
Adds free form model generation in python-experimental (#7373)
* Adds free form model generation in python-experimental

* Adds hasValidation property to codegenModel

* Adds separate variable val

* Samples regenerated

* Updates test_some_object.py

* Adds two more boolean conditions

* Runs ensure up to date

* Updates tests to check that models are or are not generated

* Removes unused import

* Updates model names in java test

* Removes unneeded test

* Cleans up tests
2020-09-20 10:55:54 -07:00
Nicholas Muesch
32c591d9a7
Support multiple api keys in python example documentation (#7417)
* Support multiple api keys in config option

* Regenerate samples

* Update rest of examples
2020-09-15 13:40:48 -07:00
Slavek Kabrda
be40dbe540
[Go][client] Re-add deleted model template files (#7423)
* [Go][client] Re-add deleted model template files

* Regenerate samples
2020-09-15 22:25:45 +08:00
William Cheng
8fad36c898
[Go] minor format change, deprecate "withGoCodegenComment" option (#7375)
* use tab in comment, remove withGoCodegenComment

* deprecated option
2020-09-12 22:05:10 +08:00
Ryan Rishi
2d5b2726d0
Subclass Python exceptions (#7321)
* Subclass Python exceptions:
- UnauthorizedException (401)
- ForbiddenException (403)
- NotFoundException (404)
- ServiceException [500 - 599]

Fixes #2151

* add generated sample code

* use Python 2 flavor inheritance

* regenerate samples
2020-09-05 10:22:04 -07:00
William Cheng
2fd23f505e
Prepare 5.0.0-SNAPSHOT (#7347)
* Revert "Prepare 5.0.0-beta2 release (#7345)"

This reverts commit 212b4f784742744b7b238607dcefb23ec9db64d7.

* update readme
2020-09-04 15:31:54 +08:00
William Cheng
212b4f7847
Prepare 5.0.0-beta2 release (#7345)
* update version

* update doc

* update samples
2020-09-04 13:03:45 +08:00
William Cheng
14d41310b9
[Go] replace go generator with go-experimental generator (#7337)
* replace go with go-experimental

* update samples

* extends with abstract go class

* rearrange

* remove deprecated

* minor fix

* remove go deprecated samples

* update pom, clean up samples

* mark generator as deprecated
2020-09-04 09:56:42 +08:00
Jim Schubert
a6d30cac9d
[core] Templating: limit compilation to supported extensions and constrain target paths (#6598) 2020-09-02 15:52:35 -04:00
William Cheng
966b87e66c
add aws v4 signature support to go-experimental (#7326) 2020-09-02 15:28:22 +08:00
William Cheng
d50d31cd5e
add structPrefix support to go-experimental (#7327) 2020-09-01 20:51:37 +08:00
Arvind Thirunarayanan
ab5b0fa8d4
[Go]: Interface definitions for api functions (#5914)
Introduces a new "generateInterfaces" option, allowing for better testability of generated clients
2020-08-31 21:43:40 -04:00
Oleh Kurpiak
14a500c6fe
[Java][Client] Use java8 OffsetDateTime for clients (#7190)
* use java8 OffsetDateTime for clients

* use java8 OffsetDateTime for clients

* fix javadoc

* add javadoc to JavaTimeFormatter.mustache

* add javadoc to JavaTimeFormatter.mustache

* add javadoc to JavaTimeFormatter.mustache
2020-08-31 22:31:28 +08:00
QP Hou
30074833cd
fix http bear auth documentation for go clinets (#7312) 2020-08-31 13:43:34 +08:00
Jiri Kuncar
d5a680e85f
[Extensions][Go][Java] Test x-auth-id-alias (#6642)
Co-authored-by: Jim Schubert <james.schubert@gmail.com>
2020-08-30 21:46:55 -04:00
William Cheng
26c17c5774
[Java] remove deprecated jackson classes (#7304)
* [java/resttemplate] Generate valid code if no Authentication implementations present

Take the logic used to decide which instances to add to the authentications map and re-use to not import classes or offer non-functional util methods

* parameterize formParams

fixes #5782

* replace use of ISO8601DateFormat and ISO8601Utils with StdDateFormat

fixes #5779

* add constructor to intialise calendar

* Revert "[java/resttemplate] Generate valid code if no Authentication implementations present"

This reverts commit 6e450907bae1d831a4a8c9b66f6b707424f0a39a.

* Revert "parameterize formParams"

This reverts commit 7a26ce5dd21ce147ed33728cd0091a29175367a4.

* also override single arg parse method to avoid throwing exception

* also override single arg parse method to avoid throwing exception

* update samples

* update samples

* fix jersey1 tests

* fix jersey2 test

* update resteasy dependencies

* fix java jersey2 oas3 tests

* use java8 in springboot-beanvalidation

Co-authored-by: Jon Freedman <jon.freedman@zoho.com>
2020-08-27 23:13:56 +08:00
William Cheng
8c1f6fcdc1
[Java][jersey2]Support enum discriminator value in child objects (#7267)
* support enum discriminator value in child (java jersey2)

* update samples

* add tests, use public
2020-08-27 11:42:48 +08:00
Niels Pardon
d868fd6dc8
[Java][clients] remove java.lang prefix from Object (#6806) 2020-08-24 22:06:19 -04:00
TIm Clark
cbdedff0ad
[Java][jersey2] Add jersey injection dependencies (#7240)
* Adds the jersey injection dependency to gradle and sbt to match
the maven dependency.
* Update jersey version in sbt
2020-08-21 16:51:11 +08:00
spacether
866df36c94
[python-exp] simplify examples (#7157)
* Adds example setting code in python-experimental with one fn setting example values

Fixes sample indentations

Handles composed schema models, object model and arraymodels

Adds brackets in arraymodel input

Sets modelName with map schemas

Removes included_schemas arguments, dicriminator examples do not include property examples

Refactors modelName into toExampleValueRecursive argument

Fixes bug where example models contained themselves

Stops using model ExampleGenerator examples because they are inconsistent with the ones in python-experimental

Uses example values if they exist

Removes single quotes from enum examples

Fixes password example

Adds commented our regex handling, commented out because it breaks

Handles AnyType schema examples

Adds x_example values for simple string properties, uses toExampleValue for all example generation

Adds examples for simple string parameters

Updates comments in toExampleValueBase

Fixes the double nested bug for AdditionalPropertiesWithArrayOfEnums

Fixes bug where NumberWithValidations had double nesting

Updates simple string examples in arrays

Fixes array string examples

Fixes example for string endpoint body example

Adds exampleFromStringOrArraySchema

Adds regex examples, pegs slf4j-version to v1.7.29 for rgxgen

Adds comment about regex seed

Updates pattern matcher to not handle ^ and $

Updates used sample values

Adds ensureQuotes

Adds ensureQuotes

Fixes double quote bug

Updates mustache file

Adds ensureQuotes to key handling

Adds modelNameToSchema map, reduces run time by using it

Fixes java tests

Regenerates python-experimental samples

Fixes python test

* Rebased on master

* Adds getModelNameToSchemaCache

* Updates toDefaultValue to not mutate schemas

* Has all dates and datetimes default and example setting use the same helper function

* Samples regenerated

* indentation tweak, removes txt from sample file
2020-08-19 21:27:31 -07:00
TIm Clark
6653cedcc7
[python-experimental] Fix model tests (#7139)
* [python-experimental] Fix model tests

* Fixes model tests to template off the classname instead of
the model's description.
* Uses python-experimental templates when generating
python-experimental samples

* Fix sample file manifest

* Restore remaining tests
2020-08-11 18:38:58 -07:00
Christian Gibson
d37216a411
[python{,-experimental}] Obey floating point timeouts provided to RESTClientObject.request(...) (#7154)
* [fix] support floating point timeout durations

* [lint] generate samples, rebuild project
2020-08-10 13:11:29 -07:00
William Cheng
1ee57ea853
[C#] Switch the spec to OAS v3 from v2 (#7176)
* switch to 3.0 spec in c# clients

* remove samples/openapi3/client/petstore/csharp

* remove samples/openapi3/client/petstore/csharp-netcore/OpenAPIClient

* remove samples/openapi3/client/petstore/csharp-netcore/OpenAPIClientCore/

* update samples
2020-08-10 20:48:13 +08:00
William Cheng
4a7c4ac81d
add helper methods to anyOf in java models (#7130) 2020-08-06 15:12:44 +08:00
William Cheng
c1b8c294aa
[Java][jersey2] Add helper methods for oneOf Java classes (#7115)
* add helper methods for oneOf java class

* better test comment
2020-08-05 10:27:38 +08:00
Nathan Mische
b8e87bb6fc
Update to reset httpRepsonse.Body (#6948)
* Update to reset httpRepsonse.Body such that is available to client consumers via the returned httpResponse variable.

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-08-04 10:34:41 +08:00
Jim Schubert
7a846a193a
[bug][core] Copy all attributes (not properties) on composed schemas when flattening models (#7106) 2020-08-03 21:16:47 -04:00
Yuriy Belenko
6a08ec59c0
[core] Add type and format properties to model of inline response (#6153) 2020-08-03 18:37:37 -04:00
William Cheng
a9576a1e2b
fix http signaure auth in build.sbt (#7110) 2020-08-03 10:10:47 +08:00
TIm Clark
800d9453a4
[Java][jersey2]Fix gradle HttpSignatureAuth dependencies (#7096)
* Corrects tag for including HttpSignatureAuth in gradle builds
* Updates version of org.tomitribe:tomitribe-http-signatures in
gradle template to match version from maven template
* Updates samples
2020-08-02 16:18:44 +08:00
William Cheng
a7ccc4addd
[Go][Exp] better code format (#7088)
* go-exp-format

* replace spaces with tabs
2020-08-01 10:12:28 +08:00
Justin Black
798ad2f87d
[python-experimental] simplifies json serialization (#7061)
* Requires python >= 3.5, adds type hints to call_api method

* Adds type hints to files_parameters and __call_api

* Adds and uses a new json encoded to prepare data before it is sent

* Removes nose name from gitlab testing invocations

* Also updates travis to py>=3.5

* Collapses encoder back into sanitize_for_serialization
2020-07-28 08:16:19 -07:00
Justin Black
ee0686e13f
Python-exp clean up model classnames (#7054)
* Adds lazy_import, removes python-exp java class renaming code, partial removal of getPythonClassName call sites

Fixes PythonClientExperimentalTest.java

Python-exp smaples regeneration

Revers makefile

Reverst pom.xml

Fixes model imports in models.__init__

Updates docstring, omits lazy import in additional properties if we dont need it

Improves additional_properties_type assignment if None

Removes getPythonClassName

Fixes python-exp tests

* Removes unused makefiles
2020-07-27 18:35:41 -07:00
QP Hou
dba14f5ac6
[Go] support problem details HTTP API (#6793)
Based on https://tools.ietf.org/html/draft-ietf-appsawg-http-problem-00, the content-type would be `application/problem+json`
2020-07-26 15:36:19 +08:00
TIm Clark
9592754e57
[Java][jersey2] Test HttpSignature verification (#7047)
* [Java][jersey2] Test HttpSignature verification

Tests that `HttpSignatureAuth` headers can be verified after
signing.

* Fix formatting
2020-07-26 15:24:59 +08:00
William Cheng
04c41d47a2
[Java][jersey2] fix query parameters in applyToParams (#7028)
* fix query parameters in applyToParams

* update samples
2020-07-24 18:44:15 +08:00
William Cheng
1897f6f96c update samples 2020-07-24 12:07:23 +08:00
Slavek Kabrda
03e8aee8ea
[java][jersey2-client] Disable coercion of scalars (#6811)
* [java][jersey2-client] Disable coercion of scalars

* Respect the coercion objectmapper setting in deserializers

* Update jackson in maven plugin to get version that has ALLOW_COERCION_OF_SCALARS
2020-07-23 16:33:15 +08:00
William Cheng
d1fe2e17f1 update samples 2020-07-23 15:01:22 +08:00
William Cheng
9899315aab
[Java][jersey2] Fix serializeToString (#6956)
* fix empty get body in serializeToString, add tests

* add new file

* fix serialize to better handle null string

* update test comments
2020-07-23 10:39:04 +08:00
Justin Black
0e0f8eb74c
[python-experimental] Removes python2 (#6991)
* Removes future from python-exp v3 sample

* Removes future from python-exp v2 sample

* Deletes future from remaining python-exp files

* Removes six from python-exp templates

* Removes six from python-exp samples

* Removes mock from python-exp

* Python-exp switched to py3

* Removes python 2.7 for python-exp ci testing

* Requires python>=3.3 for python-exp

* Reverts unnecessary changes to two templates
2020-07-19 09:45:56 -07:00
Justin Black
ed84280108
Python-exp remove codegemodel mutation, allow mixed OneOf types (#6797)
* Stops converting primitive models into object models, adds ComposedSchemas with mixed type

* Samples update for python-exp
2020-07-18 10:13:22 -07:00
Sebastien Rosset
968f32b55e
[Java][Jersey2] Add JsonTypeName annotation (#6551)
* Mustache template should use invokerPackage tag to generate import

* add JsonSubTypes annotation to handle scenario when OAS name has special characters

* add JsonSubTypes annotation to handle scenario when OAS name has special characters. Add unit test

* run sample scripts

* fix unit test

* run sample scripts

* add minimal openapi document to show issue with special characters and discriminators

* Add 'isClassnameSanitized' tag

* Add 'isClassnameSanitized' tag

* Add 'isClassnameSanitized' tag

* Add 'isClassnameSanitized' tag

* Add 'isClassnameSanitized' tag

* Add 'isClassnameSanitized' tag

* Add unit tests for unmarshaling of discriminators with special characters

* Add unit tests for unmarshaling of discriminators with special characters

* use JsonTypeName

Co-authored-by: Vikrant Balyan (vvb) <vvb@cisco.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-07-18 21:56:41 +08:00
Bodo Graumann
7cb8766a5c
[Typescript] Fix array model of alias to array (#6888)
* Add failing test

* Add model unaliasing

* Regenerate samples

Not really related to this bug fix, but probably necessary for ci
checks.
2020-07-16 16:31:41 +02:00
William Cheng
a348f5a170
[Go] fix unmarshal for models with parents (#6946)
* set disallowAdditionalPropertiesIfNotPresent to false in go exp oas3

* fix unmarshal in go

* remove fields from embedded structs

* fix typo
2020-07-16 14:52:30 +08:00