diff --git a/api/openapi.yaml b/api/openapi.yaml index 98fda428df..859121d534 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -108173,7 +108173,7 @@ components: type: boolean description: Choices are automatically ordered alphabetically choices_count: - type: string + type: integer readOnly: true created: type: string diff --git a/docs/CustomFieldChoiceSet.md b/docs/CustomFieldChoiceSet.md index ebc8229ca5..dfb96caf13 100644 --- a/docs/CustomFieldChoiceSet.md +++ b/docs/CustomFieldChoiceSet.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **BaseChoices** | Pointer to [**CustomFieldChoiceSetBaseChoices**](CustomFieldChoiceSetBaseChoices.md) | | [optional] **ExtraChoices** | **[][]interface{}** | | **OrderAlphabetically** | Pointer to **bool** | Choices are automatically ordered alphabetically | [optional] -**ChoicesCount** | **string** | | [readonly] +**ChoicesCount** | **int32** | | [readonly] **Created** | **NullableTime** | | [readonly] **LastUpdated** | **NullableTime** | | [readonly] @@ -20,7 +20,7 @@ Name | Type | Description | Notes ### NewCustomFieldChoiceSet -`func NewCustomFieldChoiceSet(id int32, url string, display string, name string, extraChoices [][]interface{}, choicesCount string, created NullableTime, lastUpdated NullableTime, ) *CustomFieldChoiceSet` +`func NewCustomFieldChoiceSet(id int32, url string, display string, name string, extraChoices [][]interface{}, choicesCount int32, created NullableTime, lastUpdated NullableTime, ) *CustomFieldChoiceSet` NewCustomFieldChoiceSet instantiates a new CustomFieldChoiceSet object This constructor will assign default values to properties that have it defined, @@ -212,20 +212,20 @@ HasOrderAlphabetically returns a boolean if a field has been set. ### GetChoicesCount -`func (o *CustomFieldChoiceSet) GetChoicesCount() string` +`func (o *CustomFieldChoiceSet) GetChoicesCount() int32` GetChoicesCount returns the ChoicesCount field if non-nil, zero value otherwise. ### GetChoicesCountOk -`func (o *CustomFieldChoiceSet) GetChoicesCountOk() (*string, bool)` +`func (o *CustomFieldChoiceSet) GetChoicesCountOk() (*int32, bool)` GetChoicesCountOk returns a tuple with the ChoicesCount field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetChoicesCount -`func (o *CustomFieldChoiceSet) SetChoicesCount(v string)` +`func (o *CustomFieldChoiceSet) SetChoicesCount(v int32)` SetChoicesCount sets ChoicesCount field to given value. diff --git a/model_custom_field_choice_set.go b/model_custom_field_choice_set.go index 3689307dbf..7f2532b11b 100644 --- a/model_custom_field_choice_set.go +++ b/model_custom_field_choice_set.go @@ -30,7 +30,7 @@ type CustomFieldChoiceSet struct { ExtraChoices [][]interface{} `json:"extra_choices"` // Choices are automatically ordered alphabetically OrderAlphabetically *bool `json:"order_alphabetically,omitempty"` - ChoicesCount string `json:"choices_count"` + ChoicesCount int32 `json:"choices_count"` Created NullableTime `json:"created"` LastUpdated NullableTime `json:"last_updated"` AdditionalProperties map[string]interface{} @@ -42,7 +42,7 @@ type _CustomFieldChoiceSet CustomFieldChoiceSet // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCustomFieldChoiceSet(id int32, url string, display string, name string, extraChoices [][]interface{}, choicesCount string, created NullableTime, lastUpdated NullableTime) *CustomFieldChoiceSet { +func NewCustomFieldChoiceSet(id int32, url string, display string, name string, extraChoices [][]interface{}, choicesCount int32, created NullableTime, lastUpdated NullableTime) *CustomFieldChoiceSet { this := CustomFieldChoiceSet{} this.Id = id this.Url = url @@ -280,9 +280,9 @@ func (o *CustomFieldChoiceSet) SetOrderAlphabetically(v bool) { } // GetChoicesCount returns the ChoicesCount field value -func (o *CustomFieldChoiceSet) GetChoicesCount() string { +func (o *CustomFieldChoiceSet) GetChoicesCount() int32 { if o == nil { - var ret string + var ret int32 return ret } @@ -291,7 +291,7 @@ func (o *CustomFieldChoiceSet) GetChoicesCount() string { // GetChoicesCountOk returns a tuple with the ChoicesCount field value // and a boolean to check if the value has been set. -func (o *CustomFieldChoiceSet) GetChoicesCountOk() (*string, bool) { +func (o *CustomFieldChoiceSet) GetChoicesCountOk() (*int32, bool) { if o == nil { return nil, false } @@ -299,7 +299,7 @@ func (o *CustomFieldChoiceSet) GetChoicesCountOk() (*string, bool) { } // SetChoicesCount sets field value -func (o *CustomFieldChoiceSet) SetChoicesCount(v string) { +func (o *CustomFieldChoiceSet) SetChoicesCount(v int32) { o.ChoicesCount = v } diff --git a/scripts/fix-spec.py b/scripts/fix-spec.py index fac390124a..4b45f8385c 100755 --- a/scripts/fix-spec.py +++ b/scripts/fix-spec.py @@ -10,7 +10,7 @@ # Traverse schemas if 'components' in data and 'schemas' in data['components']: - for name, schema in data['components']['schemas'].items(): + for component_name, schema in data['components']['schemas'].items(): if 'properties' in schema: # Remove "null" item from nullable enums for name, prop in schema['properties'].items(): @@ -39,7 +39,19 @@ for ntype in non_nullable_types: if ntype in schema['properties']: if schema['properties'][ntype]['format'] == 'binary': - schema['properties'][ntype].pop('nullable') + if 'nullable' in schema['properties'][ntype]: + schema['properties'][ntype].pop('nullable') + + change_type = { + "CustomFieldChoiceSet": { + "choices_count": "integer" + } + } + + if component_name in change_type.keys(): + for propertie in change_type[component_name].keys(): + schema['properties'][propertie]['type'] = change_type[component_name][propertie] + # Save the spec file with open(SPEC_PATH, 'w') as file: