172 Commits

Author SHA1 Message Date
William Cheng
3bf8ca7484
[python] Renames python generators (#7965)
* python->python-legacy, python-experimental->python

* test with openjdk8

* test with openjdk11

* comment out rm

* move kotlin tests to circleci

* move kotlin tests

* move tests to circleci

* fix circleci

* rearrange test

* move tests

* use wrapper

Co-authored-by: Justin Black <justin.a.black@gmail.com>
2020-11-18 14:34:00 +08:00
Nicholas Muesch
eceac6a63c
Skip validation if input_value is None (#7845) 2020-11-08 12:27:58 -08:00
Steve B
ea2cdd23c2
[python] add socket_options to configuration for the rest client (#7795)
* [python] add socket_options to configuration for the rest client

* (python-experimental) add socket_options to configuration for the rest client

This mirrors work done on the python generator

* (python-experimental) add test to cover socket_options is passed on from configuration

Co-authored-by: steve brazier <steve.brazier@trioptima.com>
2020-10-27 18:22:28 -07:00
William Cheng
fe38a50365
[Ruby][faraday] fix response streaming (#7734)
* test file return

* fix stream response

* use options

* use local var

* fix nil tempfile

* fix tempfile

* fix tempfile

* use stream

* check content

* open temp file

* test ruby file download

* fix stream data

* test faraday

* catch connection error

* catch Faraday::ConnectionFailed

* catch all error

* use sream

* refactor

* fi download file in faraday

* local fix

* fi streaming download

* undo changess to spec, test

* undo changes to spec
2020-10-26 10:07:45 +08:00
Maksym Melnychok
b70edd7f1b
[python] Add option to return None instead of raising exception when accessing unset attribute (#7784)
* add option to return None instead of raising exception when accessing unset attribute

* update python samples

* reimplement getattr using getitem or get depending on attrNoneIfUnset

* move getattr and setattr to respective templates

* update docstrings, def get/setattr methods to have docstrings in them, use __dict__ to avoid recursion issues

* revert required_properties change

* add manual tests for .get method
2020-10-25 09:13:22 -07:00
William Cheng
ec74b06d2c
[Ruby] Replace DateTime with Time (#7656)
* replace DateTime with Time

* add require time

* update doc
2020-10-21 14:13:59 +08:00
Maksym Melnychok
8416fff568
[python-experimental] implement in operator for model classes (#7637)
* implement  operator for model classes

* refresh samples
2020-10-09 10:38:15 -07:00
William Cheng
a287c51b97
update default faraday versions (#7538) 2020-10-02 18:46:49 +08:00
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
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
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
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
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
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
William Cheng
61789475ea update python samples 2020-07-03 18:51:31 +08:00
Jiri Kuncar
8b9c070e5d
[Python] Support for per-operation servers (#6557)
* Dynamic server support

* regenerated

* Apply suggestions from code review

Co-authored-by: Thomas Hervé <thomas.herve@datadoghq.com>

* regenerated

* Add ParameterizedServer feature to Python experimental

* Fix lookup of server variables

* Add tests and change default value for servers

* Fix server variables

* Return base path when index is None

* Use HOST

* Apply suggestions from code review

* Apply suggestions from code review

* regenerated

* Add specific tests for dynamic servers

* regenerated

* add docstring

* regenerated

* Fix wrong merge resolution

Co-authored-by: Thomas Hervé <thomas.herve@datadoghq.com>
2020-06-25 21:28:54 -07:00