[codegen][python-experimental] Composed schema with additionalProperties (#6290)

* Mustache template should use invokerPackage tag to generate import

* Add a unit test for allOf and additionalProperties

* Fix getAdditionalProperties

* Add code comments

* Add code comments

* set nullable for additionalproperties

* add variants of additionalProperties

* Add more unit tests

* Handle additionalProperties for composed schemas

* improve code comments

* Add code comments

* Add code comments

* Add code comments

* Add code comments

* Add code comments

* Add assertions in unit tests

* Add new property to support the 'additionalProperties' keyword with composed schemas

* run sample scripts

* fix unit tests to handle additionalProperties

* Handle additional properties and composed schema

* Handle additional properties and composed schema

* Add support for additionalProperties and composed schema

* Format java code

* Add more unit tests for Python

* Handle reference in additionalProperty keyword

* Handle reference in additionalProperty keyword

* Add use case for additionalProperties and reference

* run sample scripts

* resolve schema reference

* Add OpenAPI argument

* Add OpenAPI argument

* Add OpenAPI argument

* Add OpenAPI argument

* Add OpenAPI argument

* Handle additional property keyword with reference

* Handle additional property keyword with reference

* Handle additional property keyword with reference

* Handle additional property keyword with reference

* add additionalproperties attribute with boolean values

* Run sample scripts

* handle additional properties

* Handle additionalProperties boolean values

* Run sample scripts

* fix javadoc issues

* fix javadoc issues

* Add Locale to String.toLowerCase

* execute sample scripts

* handle additional properties

* Add code comments

* Handle imports of referenced models in additional properties

* Handle isNullable class

* handle nullable type

* improve documentation, run sample scripts

* improve documentation, run sample scripts

* execute sample scripts

* execute sample scripts

* Execute sample scripts

* Run samples scripts

* set legacyAdditionalPropertiesBehavior to true by default, except python

* create separate yaml file to avoid having lots of changes in the pr

* create separate yaml file to avoid having lots of changes in the pr

* create separate yaml file to avoid having lots of changes in the pr

* create separate yaml file to avoid having lots of changes in the pr

* create separate yaml file to avoid having lots of changes in the pr

* create separate yaml file to avoid having lots of changes in the pr

* Change name of CLI option

* Generate doc

* Add TODO statement

* add code comments

* run samples scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* refactor cli option for additional properties

* refactor cli option for additional properties

* run samples scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* Add yaml comments

* small refactor

* small refactor

* run sample scripts

* run sample scripts

* fix unit tests

* Set disallowAdditionalPropertiesIfNotPresent flag

* reduced size of test yaml file

* simplify code and add imports directly

* rename some of the properties used in tests

* Handle more scenarios for nullable types

* add code comments

* Adds *args input to __init__ method to fix test testFruitNullValue

* Resolve merge issues

* run samples scripts

* run doc generator

* fix merge conflicts

Co-authored-by: Justin Black <justin.a.black@gmail.com>
This commit is contained in:
Sebastien Rosset
2020-05-28 09:40:48 -07:00
committed by GitHub
parent 07647b1a31
commit f7f41410e7
369 changed files with 4312 additions and 465 deletions

View File

@@ -5,6 +5,12 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**map_property** | **{str: (str,)}** | | [optional]
**map_of_map_property** | **{str: ({str: (str,)},)}** | | [optional]
**anytype_1** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
**map_with_undeclared_properties_anytype_1** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional]
**map_with_undeclared_properties_anytype_2** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional]
**map_with_undeclared_properties_anytype_3** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional]
**empty_map** | **bool, date, datetime, dict, float, int, list, str** | an object with no declared properties and no undeclared properties, hence it&#39;s an empty map. | [optional]
**map_with_undeclared_properties_string** | **{str: (str,)}** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -6,6 +6,7 @@ Name | Type | Description | Notes
**class_name** | **str** | |
**declawed** | **bool** | | [optional]
**color** | **str** | | [optional] if omitted the server will use the default value of 'red'
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -5,6 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**pet_type** | **str** | |
**name** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -5,6 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**shape_type** | **str** | |
**quadrilateral_type** | **str** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -6,6 +6,7 @@ Name | Type | Description | Notes
**class_name** | **str** | |
**breed** | **str** | | [optional]
**color** | **str** | | [optional] if omitted the server will use the default value of 'red'
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -5,8 +5,9 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**main_shape** | [**shape.Shape**](Shape.md) | | [optional]
**shape_or_null** | [**shape_or_null.ShapeOrNull**](ShapeOrNull.md) | | [optional]
**nullable_shape** | [**nullable_shape.NullableShape, none_type**](NullableShape.md) | | [optional]
**nullable_shape** | [**nullable_shape.NullableShape**](NullableShape.md) | | [optional]
**shapes** | [**[shape.Shape]**](Shape.md) | | [optional]
**any string name** | **fruit.Fruit** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -5,6 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**shape_type** | **str** | |
**triangle_type** | **str** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -7,6 +7,7 @@ Name | Type | Description | Notes
**has_baleen** | **bool** | | [optional]
**has_teeth** | **bool** | | [optional]
**type** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -9,13 +9,13 @@ Name | Type | Description | Notes
**string_prop** | **str, none_type** | | [optional]
**date_prop** | **date, none_type** | | [optional]
**datetime_prop** | **datetime, none_type** | | [optional]
**array_nullable_prop** | **[bool, date, datetime, dict, float, int, list, str], none_type** | | [optional]
**array_and_items_nullable_prop** | **[bool, date, datetime, dict, float, int, list, str, none_type], none_type** | | [optional]
**array_items_nullable** | **[bool, date, datetime, dict, float, int, list, str, none_type]** | | [optional]
**object_nullable_prop** | **{str: (bool, date, datetime, dict, float, int, list, str,)}, none_type** | | [optional]
**object_and_items_nullable_prop** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional]
**object_items_nullable** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
**array_nullable_prop** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type** | | [optional]
**array_and_items_nullable_prop** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type** | | [optional]
**array_items_nullable** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type]** | | [optional]
**object_nullable_prop** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type** | | [optional]
**object_and_items_nullable_prop** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type** | | [optional]
**object_items_nullable** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}** | | [optional]
**any string name** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -7,6 +7,7 @@ Name | Type | Description | Notes
**shape_type** | **str** | |
**quadrilateral_type** | **str** | | defaults to nulltype.Null
**triangle_type** | **str** | | defaults to nulltype.Null
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**pet_type** | **str** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**class_name** | **str** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -5,6 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**quadrilateral_type** | **str** | |
**shape_type** | **str** | | defaults to nulltype.Null
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -5,6 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**shape_type** | **str** | |
**triangle_type** | **str** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -6,6 +6,7 @@ Name | Type | Description | Notes
**shape_type** | **str** | |
**quadrilateral_type** | **str** | | defaults to nulltype.Null
**triangle_type** | **str** | | defaults to nulltype.Null
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -7,6 +7,7 @@ Name | Type | Description | Notes
**shape_type** | **str** | |
**quadrilateral_type** | **str** | | defaults to nulltype.Null
**triangle_type** | **str** | | defaults to nulltype.Null
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -5,6 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**shape_type** | **str** | |
**quadrilateral_type** | **str** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -5,6 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**triangle_type** | **str** | |
**shape_type** | **str** | | defaults to nulltype.Null
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -11,8 +11,8 @@ Name | Type | Description | Notes
**password** | **str** | | [optional]
**phone** | **str** | | [optional]
**user_status** | **int** | User Status | [optional]
**object_with_no_declared_props** | **bool, date, datetime, dict, float, int, list, str** | test code generation for objects Value must be a map of strings to values. It cannot be the &#39;null&#39; value. | [optional]
**object_with_no_declared_props_nullable** | **bool, date, datetime, dict, float, int, list, str, none_type** | test code generation for nullable objects. Value must be a map of strings to values or the &#39;null&#39; value. | [optional]
**object_with_no_declared_props** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | test code generation for objects Value must be a map of strings to values. It cannot be the &#39;null&#39; value. | [optional]
**object_with_no_declared_props_nullable** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | test code generation for nullable objects. Value must be a map of strings to values or the &#39;null&#39; value. | [optional]
**any_type_prop** | **bool, date, datetime, dict, float, int, list, str, none_type** | test code generation for any type Here the &#39;type&#39; attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional]
**any_type_prop_nullable** | **bool, date, datetime, dict, float, int, list, str, none_type** | test code generation for any type Here the &#39;type&#39; attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The &#39;nullable&#39; attribute does not change the allowed values. | [optional]

View File

@@ -5,6 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**class_name** | **str** | |
**type** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)