13 Commits

Author SHA1 Message Date
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
dad931a25a
Python exp sample component renaming + additions (#6917)
* Stops converting primitive models into object models, adds ComposedSchemas with mixed type

* Reverts java and mustache changes

* Reverts mroe files

* Samples regen

* Fixes remaining tests
2020-07-13 10:22:03 -07:00
Justin Black
d8c422398e
[python-experimental] Quicken package loading (#6437)
* apis and models contains all apis and models, omits loading them in the package namespace

* Runs git add -a and commits it

* Fixes test_outer_enum.py

* Fixes test_fruit.py

* Updates test_fruit and test_mammal

* Fixes test_parent_pet

* Updates test_discard_unknown_properties.py

* Updates test_deserialization.py

* Updates v2 docs md files for apis + the readme

* Fixes v2 tests

* v2 doc updates

* Updates v3 docs

* Reverts python_doc_auth_partial.mustache

* Adds sys to v3 tests

* Adds FILES update

Co-authored-by: Justin Black <justinblack@justins-air.lan>
2020-06-01 00:25:37 -07: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
Fabian von Feilitzsch
c943ecfe28
[Python] 5094 followup - Reduce redundancy in docs (#5161)
* Reduce redundancy in python docs

This is a followup to PR #5094, which had a few unresolved comments at
merge time. This reduces the amount of redundant lines in the api
example doc templates, and ensures that referenced Configuration objects
are actually instantiated.

* Regenerate samples
2020-02-06 13:58:17 -08:00
Fabian von Feilitzsch
15345e1620
[python] Cleanup ThreadPool with atexit rather than __del__ (#5094)
* [python] Cleanup ThreadPool with atexit rather than __del__

This removes the `__del__` function from the generated Python client,
and replaces it with a `cleanup` function. When a ThreadPool is created,
the cleanup function is registered with the `atexit` module.

This fixes #5093, where the API client could hang indefinitely at
garbage collection.

* Update petstore examples

* Test to ensure threadpool is cleaned up

* Docs now encourage using the context manager

* Regenerate docs

* Update samples
2020-01-28 21:58:11 -08:00
Jim Schubert
78bf3adc4a
[core] Initial FeatureSet structures and definitions (#3614)
[core] Initial FeatureSet structures and definitions
Add default feature set to DefaultCodegen
Initial FeatureSet definitions for:

*  ada 
*  android 
*  apache2 
*  asciidoc 
*  aspnetcore 
*  avro 
*  bash 
*  c 
*  clojure 
*  cpp-pistache-server 
*  cpp-qt5-client 
*  cpp-qt5-qhttpengine-server 
*  cpp-restbed-server 
*  cpp-restsdk 
*  cpp-tizen 
*  csharp 
*  csharp-nancyfx 
*  csharp-netcore 
*  cwiki 
*  dart 
*  eiffel 
*  elixir 
*  elm 
*  erlang 
*  flash 
*  fsharp-functions 
*  go  Client/Server
*  graphql-nodejs-express-server 
*  graphql-schema 
*  groovy 
*  haskell 
*  haskell-http-client 
*  java 
*  jmeter 
*  kotlin 
*  kotlin vertx 
*  kotlin-server 
*  kotlin-spring 
*  lua 
*  mysql 
*  nim 
*  nodejs 
*  nodejs-express 
*  objc 
*  ocaml 
*  openapi 
*  openapi-yaml 
*  perl 
*  php 
*  php-laravel 
*  php-lumen 
*  php-silex 
*  php-slim 
*  php-symfony 
*  php-ze-ph 
*  powershell 
*  protobuf 
*  protobuf-schema 
*  python 
*  python-aiohttp 
*  python-blueplanet 
*  python-experimental 
*  r 
*  ror 
*  ruby 
*  ruby 
*  ruby-sinatra 
*  rust 
*  scala-akka 
*  scala-finch 
*  scala-gatling 
*  scala-http-client 
*  scala-lagom 
*  scala-play 
*  scalatra 
*  scalaz 
*  spring 
*  static docs 
*  swift 
*  typescript
2020-01-11 16:20:47 -05:00
Justin Black
789f1a06f0 [Python] Adds allOf/oneOf/anyOf composed models (#4446)
* Adds composed model support for allOf oneOf anyOf

* Moves discriminator into discriminator() class method, adds test_deserialize_lizard, adds setting discriminator using allOf schema
2019-12-14 21:18:41 -05: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
Justin Black
252c3e58be [python-experimental] generate model if type != object if enums/validations exist (#2757)
* Python-experimental adds model_utils module, refactors python api class

* Fixes python-experimental so the sample sare generated in the petstore_api folder

* FIxes python samples tests

* Updates python and python-experimental tests

* Fixes python-experimental tests

* Adds newlines back to python templates + samples

* Reverts files with newline tweaks back to master branch versions

* Fixes indentation errors in python-experimental api_client

* Removes unused files

* Python files now generated in correct folders

* Adds logging when the user tries to set generateAliasAsModel in python-experimental

* Fixes typo
2019-09-24 18:44:28 +08:00
Justin Black
88af8964fd [python-experimental] automatically use values for enums of length1 (#3118)
* Update python client java generator

* Updates python generator mustache files

* Python sample regenerated

* Switches from getfullargspec to getargspec for python2 compatibility

* Uses getattr to get model class init method to correctly see its arguments, linting fixes to pass python tests

* Updates comment in python centerator to restart CI tests

* Adds bin/windows/python-experimental-petstore.bat

* CHanges spec update to apply to the python-experimental spec

* Moves new python templates to python-experimental

* Moves generator python java code to python-experimental

* Reverts python generator mustache files

* Regenerates python, v3 python, python-experimental samples

* Test moved to python-experimental, unused python files removed
2019-07-31 21:18:30 +08:00
Justin Black
109808e60d [Python] Adds new client generator, python-experimental (#3244)
* Adds python-experimental generator

* Adds python-experimental samples folder which uses its own v2 spec

* Adds enusre-up-to-date updates

* Removes samples/client/petstore/perl/t/AnotherFakeApiTest.t

* Removes comment line from python-experimental generator

* Reverts perl docs file

* Updates perl sample client

* Adds python-experimental to pom.xml

* Copies the python test foldeers tests and testfiles into python-experimental

* Copies python test folder into python-experimental

* Moves python testing from Travis (samples pom.xml profile) to Circlci (samples.circleci pom.xml profile)

* Adds python-experimental pom.xml

* Adds python-experimental makefile and .sh files

* Chenges python-experimental to use gitignored venv rather than .venv which is not ignored when testing

* Adds dev-requiremnts.txt and removes .travis.yml from python-experimental so CI tests will pass

* Moves python-experimental from CicleCI to Travis to get support for multiple python environments

* Updates generator java comment so CI tests will run over again
2019-07-06 22:43:29 +08:00