* Mustache template should use invokerPackage tag to generate import
* A float may be serialized as an integer, e.g. '3' is a valid serialized float
* A float may be serialized as an integer, e.g. '3' is a valid serialized float
* add unit tests
* Handle null type
* Handle null type
* Handle null type. Add 'null' type in the OAS document for testing purpose
* Handle null type. Add 'null' type in the OAS document for testing purpose
* Handle null type. Add 'null' type in the OAS document for testing purpose
* Handle null type. Add 'null' type in the OAS document for testing purpose
* Handle null type. Add 'null' type in the OAS document for testing purpose
* Handle null type. Add 'null' type in the OAS document for testing purpose
* improve documentation
* Handle 'null' type
* Handle 'null' type. Add unit tests
* Add NullType for go
* Add NullType for go
* fix modeling of AnyType for go-experimental
* execute scripts in bin directory
* Add review comments
* Add 'null' type in oneOf
* Improve OAS YAML file for golang openapi3 samples
* 'Any type' includes the null value, so 'isNullable' should be set to TRUE
* 'Any type' includes the null value, so 'isNullable' should be set to TRUE
* Handle AnyType and NullType
* handle anytype for go-experimental
* Log warning instead of error
* anyOf/oneOf
* Change x-golang-is-container extension to x-golang-has-wrapper
* Add code comments
* Handle Object and any type
* Handle Object and any type
* Handle object and any type
* add code comments
* handle additional properties
* handle additional properties
* handle additional properties
* handle anytype and objecttype for go-exerimental
* Move golang changes to a separate branch
* Move golang changes to a separate branch
* Better names for the OAS document test properties
* Move golang changes to a separate branch
* Run samples scripts
* Run samples scripts
* fix unit test issues
* Handle none type
* Fix index out of range exception
* fix formatting issues
* fix formatting issues
* fix formatting issues. Finally figured out how to check formatting in local workspace
* fix formatting issues
* Add reference to oneOf schema
* Add model showing unit test failure with ref to oneOf schema
* Updates get_discriminator_class to return visited_composed_classes
* Fixes broken test, adds is_valid_type
* run samples scripts
* move unit test to test_drawing.py file
* Add more unit tests
* invoke git pull from spacether fork
* invoke git pull from spacether fork
* Improve unit tests
* Add is_nullable_type util function
* Add unit test for null value
* Add 'ShapeOrNull' type to handle the oneOf/anyOf scenario when the child schema is the null type
* Support schema property which has to 'oneOf' schema and child schema is null type
* Support schema property which has to 'oneOf' schema and child schema is null type
* Support schema property which has to 'oneOf' schema and child schema is null type
* Mustache template should use invokerPackage tag to generate import
* handle null type in oneOf/anyOf
* handle null type in oneOf/anyOf
* Add more unit test for nullable shape
* resolve merge conflicts
* resolve merge conflicts
* handle null type in oneOf/anyOf
Co-authored-by: Justin Black <justin.a.black@gmail.com>
* Add reference to oneOf schema
* Add model showing unit test failure with ref to oneOf schema
* Updates get_discriminator_class to return visited_composed_classes
* Fixes broken test, adds is_valid_type
* move unit test to test_drawing.py file
* Add more unit tests
* invoke git pull from spacether fork
* invoke git pull from spacether fork
* Improve unit tests
Co-authored-by: Justin Black <justin.a.black@gmail.com>
* Handle null type
* Handle null type
* Handle null type. Add 'null' type in the OAS document for testing purpose
* Handle null type. Add 'null' type in the OAS document for testing purpose
* Handle null type. Add 'null' type in the OAS document for testing purpose
* Handle null type. Add 'null' type in the OAS document for testing purpose
* Handle null type. Add 'null' type in the OAS document for testing purpose
* Handle null type. Add 'null' type in the OAS document for testing purpose
* improve documentation
* Handle 'null' type
* Handle 'null' type. Add unit tests
* Add NullType for go
* Add NullType for go
* fix modeling of AnyType for go-experimental
* execute scripts in bin directory
* Add review comments
* Add 'null' type in oneOf
* Improve OAS YAML file for golang openapi3 samples
* 'Any type' includes the null value, so 'isNullable' should be set to TRUE
* 'Any type' includes the null value, so 'isNullable' should be set to TRUE
* Handle AnyType and NullType
* handle anytype for go-experimental
* Log warning instead of error
* anyOf/oneOf
* Change x-golang-is-container extension to x-golang-has-wrapper
* Add code comments
* Handle Object and any type
* Handle Object and any type
* Handle object and any type
* add code comments
* handle additional properties
* handle additional properties
* handle additional properties
* handle anytype and objecttype for go-exerimental
* Move golang changes to a separate branch
* Move golang changes to a separate branch
* Better names for the OAS document test properties
* Move golang changes to a separate branch
* Run samples scripts
* Run samples scripts
* fix unit test issues
* Handle none type
* Fix index out of range exception
* fix formatting issues
* fix formatting issues
* fix formatting issues. Finally figured out how to check formatting in local workspace
* fix formatting issues
* run samples scripts
* 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
* Runs ensure up to date
* Updates incorrect addOneOfInterfaceModel invocation
* Runs ensure-up-to-date
* Fix NPE when at least one extension is defined but not x-discriminator-value
* 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
* Add documentation and new getValidDiscriminatorMappings function
* Add documentation and new getValidDiscriminatorMappings function
* Add documentation and new getValidDiscriminatorMappings function
* Add documentation and new getValidDiscriminatorMappings function
* Add documentation and new getValidDiscriminatorMappings function
* Add documentation and new getValidDiscriminatorMappings function
* throw exception if discriminator mappingName argument is null
* handle scenario when composed schema has 'null' type
* remove extraneous characters in comments
* Uses df.isString
* Traverse discriminators to resolve discriminator mapping
* Fixes tests be correctly setting df.isString
* Remove unused method
* 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
* 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
* Remove exception when mappingName is null value
* Remove exception when mappingName is null value
* resolve merge conflicts
* resolve merge conflicts
* Execute scripts in the bin directory
* Fix CI issues and address PR review comments: better documentation and fix white space issues.
* Fix CI issues and address PR review comments: better documentation and fix white space issues.
* run sample scripts
* resolve merge conflicts
* fix end-of-line issue
* resolve merge conflicts
* resolve merge issues
* Handle case when discriminator is not specified in input data
* minor changes and add code comments
* Refactor get_discriminator code
* Add unit test with missing discriminator property
* improve get_discriminator function
* Run sample scripts
* add unit tests for recursive get_discriminator_class
* fix unit test issues
* fix formatting issues
* fix formatting issues
* fix formatting issues
* fix index out of range exception
* fix formatting issues
* fix formatting issues
* fix formatting issues. Finally figured out how to check formatting in local workspace
Co-authored-by: Justin Black <justin.a.black@gmail.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
* Use AttributeError instead of ApiKeyError because that's what the hasattr builtin function uses
* Use AttributeError instead of ApiKeyError because that's what the hasattr builtin function uses
* fix unit tests
* create ApiAttributeError exception
* fix formatting
* run samples scripts
* 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
* 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>
* 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
* 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
* handle scenario when value is a list, fix TypeError: unhashable type: 'list'
* Add __hash__ function
* use list instead of set
* use list instead of set
* use list instead of set
* use list instead of set
* use list instead of set
* use list instead of set
* Adds oneOf + anyOf schemas, models and tests to python-experimental
* Adds setUpClass and tearDownClass
* Removes newline in method_init_shared.mustache
* Regenerated v3 spec sample for python-experimental
* Fxes test for discard_unknown_keys
* Moves new models into existing spec, regen python-exp and go-exp
* Also fix python-exp windows file
* add discard_unknown_key parameter
* add discard_unknown_key parameter
* add discard_unknown_key parameter
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* discard unknown keys in composed schema if configuration.discard_unknown_keys is set
* run sample scripts for python
* code reformatting
* execute script in bin directory
* improve unit tests for discarding properties
* improve python documentation and add import to __init__package.mustache
* improve python documentation and add import to __init__package.mustache
* add signing_info parameter conditionally
* add code comments and remove 'Content-Length' header from example
* Remove debug log statement
* set access_token to None by default
* set access_token to None by default
* fix unit tests for Python experimental
* fix trailing space
* Updates ap.mustache for python-experimental, adds test test_test_endpoint_enums_length_one
* Removes sortParamsByRequiredFlag from python-experimental
* Removes duplicate params from docstring
* [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
* start implementation of HTTP signature
* add api key parameters for http message signature
* HTTP signature authentication
* start implementation of HTTP signature
* add api key parameters for http message signature
* HTTP signature authentication
* HTTP signature authentication
* start implementation of HTTP signature
* fix merge issues
* Address formatting issues
* Address formatting issues
* move python-experimental-openapiv3-sample to a separate PR
* Add support for HTTP signature
* Add code comments
* Add code comments
* Fix formatting issues
* Fix formatting issues
* Fix formatting issues
* add code comments
* add code comments
* fix python formatting issues
* Make PKCS1v15 string constant consistent between Python and Golang
* fix python formatting issues
* Add code comments in generated Python. Start adding unit tests for HTTP signature
* compliance with HTTP signature draft 12
* compliance with HTTP signature draft 12
* working on review comments
* working on review comments
* working on review comments
* working on review comments
* working on review comments
* working on review comments
* working on review comments
* working on review comments
* working on review comments
* fix python formatting issues
* fix trailing white space
* address PR comments
* address PR comments
* address PR comments
* Add suppport for '(expires)' signature parameter
* address PR comments
* address PR comments
* Fix python formatting issues
* Fix python formatting issues
* Starting to move code to dedicated file for HTTP signatures
* Continue to refactor code to dedicated file for HTTP signatures
* Continue to refactor code to dedicated file for HTTP signatures
* Continue to refactor code to dedicated file for HTTP signatures
* Continue to refactor code to dedicated file for HTTP signatures
* move method to ProcessUtils
* conditionally build signing.py
* move method to ProcessUtils
* Code reformatting
* externalize http signature configuration
* address PR review comments
* address PR review comments
* run samples scripts
* Address PR review comments
* Move 'private_key' field to signing module
* Move 'private_key' field to signing module
* code cleanup
* remove use of strftime('%s'), which is non portable
* code cleanup
* code cleanup
* code cleanup
* run sample scripts
* Address PR review comments.
* Add http-signature security scheme
* Run sample scripts for go
* Fix issue uncovered in integration branch
* Fix issue uncovered in integration branch
* Fix issue uncovered in integration branch
* Fix issue uncovered in integration branch
* Run samples scripts
* move http signature tests to separate file
* move http signature tests to separate file
* unit tests for HTTP signature
* continue implementation of unit tests
* add http_signature_test to security scheme
* add unit tests for http signature
* address review comments
* remove http signature from petapi
* Add separate OAS file with support for HTTP signature
* Add support for private key passphrase. Add more unit tests
* Add unit test to validate the signature against the public key
* remove http signature from petstore-with-fake-endpoints-models-for-testing.yaml
* fix unit test issues
* run scripts in bin directory
* Refact unit test with better variable names
* do not throw exception if security scheme is unrecognized
* change URL of apache license to use https
* sync from master
* fix usage of escape character in python regex. Fix generated python documentation
* write HTTP signed headers in user-specified order. Fix PEP8 formatting issues
* write HTTP signed headers in user-specified order. Fix PEP8 formatting issues
* http signature unit tests
* Fix PEP8 format issue
* spread out each requirement to a separate line
* run samples scripts
* run sample scripts
* remove encoding of '+' character
* Adds composed model support for allOf oneOf anyOf
* Moves discriminator into discriminator() class method, adds test_deserialize_lizard, adds setting discriminator using allOf schema
* 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
* 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
* 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
* 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