Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5721959
Fix code generation for free-form objects in go-experimental
sebastien-rosset Feb 20, 2020
40470a6
Execute scripts in bin directory
sebastien-rosset Feb 20, 2020
1d12a00
Add more use cases for open-ended types
sebastien-rosset Feb 21, 2020
128b6ca
Add more use cases for open-ended types
sebastien-rosset Feb 21, 2020
946bdc6
Add more use cases for open-ended types
sebastien-rosset Feb 21, 2020
7af5f83
add code comments
sebastien-rosset Feb 21, 2020
f2e4418
Better name for test properties
sebastien-rosset Feb 21, 2020
de43542
handle scenario when type is arbitrary
sebastien-rosset Feb 21, 2020
0c117c4
handle interface{} scenario
sebastien-rosset Feb 21, 2020
9ba18ef
handle interface{} scenario
sebastien-rosset Feb 21, 2020
c5a29f5
add helper function isAnyType
sebastien-rosset Feb 21, 2020
821eaeb
isAnyType function
sebastien-rosset Feb 21, 2020
16259c7
implementation of isAnyType function
sebastien-rosset Feb 21, 2020
b0d0f4a
fix javadoc issue
sebastien-rosset Feb 21, 2020
1f33e83
Merge branch 'master' of github.com:CiscoM31/openapi-generator into g…
sebastien-rosset Feb 21, 2020
9471954
handle interface{} scenario
sebastien-rosset Feb 22, 2020
48fac66
Merge remote-tracking branch 'origin' into go-experimental-free-form
sebastien-rosset Feb 26, 2020
1661128
Merge remote-tracking branch 'origin' into go-experimental-free-form
sebastien-rosset Feb 29, 2020
ee2c1cc
use equals comparison instead of ==
sebastien-rosset Mar 1, 2020
1323017
Merge branch 'master' of github.com:CiscoM31/openapi-generator into g…
sebastien-rosset Mar 12, 2020
60529ee
resolve merge conflicts
sebastien-rosset Mar 17, 2020
840a209
Merge branch 'master' of github.com:CiscoM31/openapi-generator into g…
sebastien-rosset Mar 24, 2020
1668293
merge from master
sebastien-rosset Mar 24, 2020
76ffa9e
merge from master
sebastien-rosset Mar 24, 2020
5d7be16
Merge remote-tracking branch 'origin' into go-experimental-free-form
sebastien-rosset Mar 24, 2020
4b714ad
Add code documentation
sebastien-rosset Mar 24, 2020
6c5afdd
Merge branch 'master' of github.com:CiscoM31/openapi-generator into g…
sebastien-rosset Mar 25, 2020
5cb8407
Merge branch 'master' of github.com:CiscoM31/openapi-generator into g…
sebastien-rosset Mar 25, 2020
4db388f
add code comments, remove unused min/max attribute, fix equals method
sebastien-rosset Mar 25, 2020
42cc09a
Handle 'anytype' use case
sebastien-rosset Mar 25, 2020
c70f531
add code comments
sebastien-rosset Mar 25, 2020
49d833c
override postProcessModelProperty to set vendor extension
sebastien-rosset Mar 25, 2020
2eeb4e5
Use vendorExtensions.x-golang-is-container
sebastien-rosset Mar 25, 2020
6c4c5fc
fix compilation error of generated code
sebastien-rosset Mar 25, 2020
9051376
Merge branch 'master' of github.com:CiscoM31/openapi-generator into g…
sebastien-rosset Mar 25, 2020
f736657
fix compilation error of generated code
sebastien-rosset Mar 25, 2020
5d4796c
fix compilation error of generated code
sebastien-rosset Mar 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
handle interface{} scenario
  • Loading branch information
sebastien-rosset committed Feb 21, 2020
commit 9ba18efeb5d085c559895759dbd940701338806a
Original file line number Diff line number Diff line change
Expand Up @@ -1299,11 +1299,11 @@ components:
lastName: lastName
password: password
userStatus: 6
arbitraryTypeValue: ""
arbitraryNullableTypeValue: ""
phone: phone
arbitraryType: ""
id: 0
arbitraryObject: '{}'
arbitraryNullableType: ""
email: email
arbitraryNullableObject: '{}'
username: username
Expand Down Expand Up @@ -1337,10 +1337,10 @@ components:
map of strings to values or the 'null' value.
nullable: true
type: object
arbitraryType:
arbitraryTypeValue:
description: test code generation for any type Value can be any type - string,
number, boolean, array or object.
arbitraryNullableType:
arbitraryNullableTypeValue:
description: test code generation for any type Value can be any type - string,
number, boolean, array, object or the 'null' value.
nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Name | Type | Description | Notes
**StringProp** | Pointer to **NullableString** | | [optional]
**DateProp** | Pointer to **NullableString** | | [optional]
**DatetimeProp** | Pointer to [**NullableTime**](time.Time.md) | | [optional]
**ArrayNullableProp** | Pointer to [**[]map[string]interface{}**](map[string]interface{}.md) | | [optional]
**ArrayAndItemsNullableProp** | Pointer to [**[]map[string]interface{}**](map[string]interface{}.md) | | [optional]
**ArrayItemsNullable** | Pointer to [**[]map[string]interface{}**](map[string]interface{}.md) | | [optional]
**ObjectNullableProp** | Pointer to [**map[string]map[string]interface{}**](map[string]interface{}.md) | | [optional]
**ObjectAndItemsNullableProp** | Pointer to [**map[string]map[string]interface{}**](map[string]interface{}.md) | | [optional]
**ObjectItemsNullable** | Pointer to [**map[string]map[string]interface{}**](map[string]interface{}.md) | | [optional]
**ArrayNullableProp** | Pointer to **[]map[string]interface{}** | | [optional]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a bug before this PR. There is no markdown file "map[string]interface{}.md"

**ArrayAndItemsNullableProp** | Pointer to **[]map[string]interface{}** | | [optional]
**ArrayItemsNullable** | Pointer to **[]map[string]interface{}** | | [optional]
**ObjectNullableProp** | Pointer to **map[string]map[string]interface{}** | | [optional]
**ObjectAndItemsNullableProp** | Pointer to **map[string]map[string]interface{}** | | [optional]
**ObjectItemsNullable** | Pointer to **map[string]map[string]interface{}** | | [optional]

## Methods

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Name | Type | Description | Notes
**UserStatus** | Pointer to **int32** | User Status | [optional]
**ArbitraryObject** | Pointer to [**map[string]interface{}**](.md) | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional]
**ArbitraryNullableObject** | Pointer to [**map[string]interface{}**](.md) | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional]
**ArbitraryType** | Pointer to [**map[string]interface{}**](map[string]interface{}.md) | test code generation for any type Value can be any type - string, number, boolean, array or object. | [optional]
**ArbitraryNullableType** | Pointer to [**NullableMap[string]interface{}**](map[string]interface{}.md) | test code generation for any type Value can be any type - string, number, boolean, array, object or the 'null' value. | [optional]
**ArbitraryTypeValue** | Pointer to **interface{}** | test code generation for any type Value can be any type - string, number, boolean, array or object. | [optional]
**ArbitraryNullableTypeValue** | Pointer to **NullableInterface{}** | test code generation for any type Value can be any type - string, number, boolean, array, object or the 'null' value. | [optional]

## Methods

Expand Down Expand Up @@ -293,63 +293,63 @@ SetArbitraryNullableObject gets a reference to the given map[string]interface{}
SetArbitraryNullableObjectExplicitNull (un)sets ArbitraryNullableObject to be considered as explicit "null" value
when serializing to JSON (pass true as argument to set this, false to unset)
The ArbitraryNullableObject value is set to nil even if false is passed
### GetArbitraryType
### GetArbitraryTypeValue

`func (o *User) GetArbitraryType() map[string]interface{}`
`func (o *User) GetArbitraryTypeValue() interface{}`

GetArbitraryType returns the ArbitraryType field if non-nil, zero value otherwise.
GetArbitraryTypeValue returns the ArbitraryTypeValue field if non-nil, zero value otherwise.

### GetArbitraryTypeOk
### GetArbitraryTypeValueOk

`func (o *User) GetArbitraryTypeOk() (map[string]interface{}, bool)`
`func (o *User) GetArbitraryTypeValueOk() (interface{}, bool)`

GetArbitraryTypeOk returns a tuple with the ArbitraryType field if it's non-nil, zero value otherwise
GetArbitraryTypeValueOk returns a tuple with the ArbitraryTypeValue field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### HasArbitraryType
### HasArbitraryTypeValue

`func (o *User) HasArbitraryType() bool`
`func (o *User) HasArbitraryTypeValue() bool`

HasArbitraryType returns a boolean if a field has been set.
HasArbitraryTypeValue returns a boolean if a field has been set.

### SetArbitraryType
### SetArbitraryTypeValue

`func (o *User) SetArbitraryType(v map[string]interface{})`
`func (o *User) SetArbitraryTypeValue(v interface{})`

SetArbitraryType gets a reference to the given map[string]interface{} and assigns it to the ArbitraryType field.
SetArbitraryTypeValue gets a reference to the given interface{} and assigns it to the ArbitraryTypeValue field.

### GetArbitraryNullableType
### GetArbitraryNullableTypeValue

`func (o *User) GetArbitraryNullableType() NullableMap[string]interface{}`
`func (o *User) GetArbitraryNullableTypeValue() NullableInterface{}`

GetArbitraryNullableType returns the ArbitraryNullableType field if non-nil, zero value otherwise.
GetArbitraryNullableTypeValue returns the ArbitraryNullableTypeValue field if non-nil, zero value otherwise.

### GetArbitraryNullableTypeOk
### GetArbitraryNullableTypeValueOk

`func (o *User) GetArbitraryNullableTypeOk() (NullableMap[string]interface{}, bool)`
`func (o *User) GetArbitraryNullableTypeValueOk() (NullableInterface{}, bool)`

GetArbitraryNullableTypeOk returns a tuple with the ArbitraryNullableType field if it's non-nil, zero value otherwise
GetArbitraryNullableTypeValueOk returns a tuple with the ArbitraryNullableTypeValue field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### HasArbitraryNullableType
### HasArbitraryNullableTypeValue

`func (o *User) HasArbitraryNullableType() bool`
`func (o *User) HasArbitraryNullableTypeValue() bool`

HasArbitraryNullableType returns a boolean if a field has been set.
HasArbitraryNullableTypeValue returns a boolean if a field has been set.

### SetArbitraryNullableType
### SetArbitraryNullableTypeValue

`func (o *User) SetArbitraryNullableType(v NullableMap[string]interface{})`
`func (o *User) SetArbitraryNullableTypeValue(v NullableInterface{})`

SetArbitraryNullableType gets a reference to the given NullableMap[string]interface{} and assigns it to the ArbitraryNullableType field.
SetArbitraryNullableTypeValue gets a reference to the given NullableInterface{} and assigns it to the ArbitraryNullableTypeValue field.

### SetArbitraryNullableTypeExplicitNull
### SetArbitraryNullableTypeValueExplicitNull

`func (o *User) SetArbitraryNullableTypeExplicitNull(b bool)`
`func (o *User) SetArbitraryNullableTypeValueExplicitNull(b bool)`

SetArbitraryNullableTypeExplicitNull (un)sets ArbitraryNullableType to be considered as explicit "null" value
SetArbitraryNullableTypeValueExplicitNull (un)sets ArbitraryNullableTypeValue to be considered as explicit "null" value
when serializing to JSON (pass true as argument to set this, false to unset)
The ArbitraryNullableType value is set to nil even if false is passed
The ArbitraryNullableTypeValue value is set to nil even if false is passed

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ type User struct {
// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.
ArbitraryNullableObject *map[string]interface{} `json:"arbitraryNullableObject,omitempty"`
// test code generation for any type Value can be any type - string, number, boolean, array or object.
ArbitraryType *map[string]interface{} `json:"arbitraryType,omitempty"`
ArbitraryTypeValue *interface{} `json:"arbitraryTypeValue,omitempty"`
// test code generation for any type Value can be any type - string, number, boolean, array, object or the 'null' value.
ArbitraryNullableType *NullableMap[string]interface{} `json:"arbitraryNullableType,omitempty"`
ArbitraryNullableTypeValue *NullableInterface{} `json:"arbitraryNullableTypeValue,omitempty"`
}

// NewUser instantiates a new User object
Expand Down Expand Up @@ -382,70 +382,70 @@ func (o *User) SetArbitraryNullableObject(v map[string]interface{}) {
o.ArbitraryNullableObject = &v
}

// GetArbitraryType returns the ArbitraryType field value if set, zero value otherwise.
func (o *User) GetArbitraryType() map[string]interface{} {
if o == nil || o.ArbitraryType == nil {
var ret map[string]interface{}
// GetArbitraryTypeValue returns the ArbitraryTypeValue field value if set, zero value otherwise.
func (o *User) GetArbitraryTypeValue() interface{} {
if o == nil || o.ArbitraryTypeValue == nil {
var ret interface{}
return ret
}
return *o.ArbitraryType
return *o.ArbitraryTypeValue
}

// GetArbitraryTypeOk returns a tuple with the ArbitraryType field value if set, zero value otherwise
// GetArbitraryTypeValueOk returns a tuple with the ArbitraryTypeValue field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *User) GetArbitraryTypeOk() (map[string]interface{}, bool) {
if o == nil || o.ArbitraryType == nil {
var ret map[string]interface{}
func (o *User) GetArbitraryTypeValueOk() (interface{}, bool) {
if o == nil || o.ArbitraryTypeValue == nil {
var ret interface{}
return ret, false
}
return *o.ArbitraryType, true
return *o.ArbitraryTypeValue, true
}

// HasArbitraryType returns a boolean if a field has been set.
func (o *User) HasArbitraryType() bool {
if o != nil && o.ArbitraryType != nil {
// HasArbitraryTypeValue returns a boolean if a field has been set.
func (o *User) HasArbitraryTypeValue() bool {
if o != nil && o.ArbitraryTypeValue != nil {
return true
}

return false
}

// SetArbitraryType gets a reference to the given map[string]interface{} and assigns it to the ArbitraryType field.
func (o *User) SetArbitraryType(v map[string]interface{}) {
o.ArbitraryType = &v
// SetArbitraryTypeValue gets a reference to the given interface{} and assigns it to the ArbitraryTypeValue field.
func (o *User) SetArbitraryTypeValue(v interface{}) {
o.ArbitraryTypeValue = &v
}

// GetArbitraryNullableType returns the ArbitraryNullableType field value if set, zero value otherwise.
func (o *User) GetArbitraryNullableType() NullableMap[string]interface{} {
if o == nil || o.ArbitraryNullableType == nil {
var ret NullableMap[string]interface{}
// GetArbitraryNullableTypeValue returns the ArbitraryNullableTypeValue field value if set, zero value otherwise.
func (o *User) GetArbitraryNullableTypeValue() NullableInterface{} {
if o == nil || o.ArbitraryNullableTypeValue == nil {
var ret NullableInterface{}
return ret
}
return *o.ArbitraryNullableType
return *o.ArbitraryNullableTypeValue
}

// GetArbitraryNullableTypeOk returns a tuple with the ArbitraryNullableType field value if set, zero value otherwise
// GetArbitraryNullableTypeValueOk returns a tuple with the ArbitraryNullableTypeValue field value if set, zero value otherwise
// and a boolean to check if the value has been set.
func (o *User) GetArbitraryNullableTypeOk() (NullableMap[string]interface{}, bool) {
if o == nil || o.ArbitraryNullableType == nil {
var ret NullableMap[string]interface{}
func (o *User) GetArbitraryNullableTypeValueOk() (NullableInterface{}, bool) {
if o == nil || o.ArbitraryNullableTypeValue == nil {
var ret NullableInterface{}
return ret, false
}
return *o.ArbitraryNullableType, true
return *o.ArbitraryNullableTypeValue, true
}

// HasArbitraryNullableType returns a boolean if a field has been set.
func (o *User) HasArbitraryNullableType() bool {
if o != nil && o.ArbitraryNullableType != nil {
// HasArbitraryNullableTypeValue returns a boolean if a field has been set.
func (o *User) HasArbitraryNullableTypeValue() bool {
if o != nil && o.ArbitraryNullableTypeValue != nil {
return true
}

return false
}

// SetArbitraryNullableType gets a reference to the given NullableMap[string]interface{} and assigns it to the ArbitraryNullableType field.
func (o *User) SetArbitraryNullableType(v NullableMap[string]interface{}) {
o.ArbitraryNullableType = &v
// SetArbitraryNullableTypeValue gets a reference to the given NullableInterface{} and assigns it to the ArbitraryNullableTypeValue field.
func (o *User) SetArbitraryNullableTypeValue(v NullableInterface{}) {
o.ArbitraryNullableTypeValue = &v
}

type NullableUser struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Name | Type | Description | Notes
**user_status** | **int** | User Status | [optional]
**arbitrary_object** | **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 'null' value. | [optional]
**arbitrary_nullable_object** | **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 'null' value. | [optional]
**arbitrary_type** | **object** | test code generation for any type Value can be any type - string, number, boolean, array or object. | [optional]
**arbitrary_nullable_type** | **object, none_type** | test code generation for any type Value can be any type - string, number, boolean, array, object or the 'null' value. | [optional]
**arbitrary_type_value** | **object** | test code generation for any type Value can be any type - string, number, boolean, array or object. | [optional]
**arbitrary_nullable_type_value** | **object, none_type** | test code generation for any type Value can be any type - string, number, boolean, array, object or the 'null' value. | [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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def openapi_types():
'user_status': (int,), # noqa: E501
'arbitrary_object': (bool, date, datetime, dict, float, int, list, str,), # noqa: E501
'arbitrary_nullable_object': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
'arbitrary_type': (object,), # noqa: E501
'arbitrary_nullable_type': (object, none_type,), # noqa: E501
'arbitrary_type_value': (object,), # noqa: E501
'arbitrary_nullable_type_value': (object, none_type,), # noqa: E501
}

@staticmethod
Expand All @@ -102,8 +102,8 @@ def discriminator():
'user_status': 'userStatus', # noqa: E501
'arbitrary_object': 'arbitraryObject', # noqa: E501
'arbitrary_nullable_object': 'arbitraryNullableObject', # noqa: E501
'arbitrary_type': 'arbitraryType', # noqa: E501
'arbitrary_nullable_type': 'arbitraryNullableType', # noqa: E501
'arbitrary_type_value': 'arbitraryTypeValue', # noqa: E501
'arbitrary_nullable_type_value': 'arbitraryNullableTypeValue', # noqa: E501
}

@staticmethod
Expand Down Expand Up @@ -146,8 +146,8 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf
user_status (int): User Status. [optional] # noqa: E501
arbitrary_object (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 'null' value.. [optional] # noqa: E501
arbitrary_nullable_object (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 'null' value.. [optional] # noqa: E501
arbitrary_type (object): test code generation for any type Value can be any type - string, number, boolean, array or object.. [optional] # noqa: E501
arbitrary_nullable_type (object, none_type): test code generation for any type Value can be any type - string, number, boolean, array, object or the 'null' value.. [optional] # noqa: E501
arbitrary_type_value (object): test code generation for any type Value can be any type - string, number, boolean, array or object.. [optional] # noqa: E501
arbitrary_nullable_type_value (object, none_type): test code generation for any type Value can be any type - string, number, boolean, array, object or the 'null' value.. [optional] # noqa: E501
"""

self._data_store = {}
Expand Down