Skip to content

Commit 00ac46b

Browse files
committed
fix: choices_count is integer not string
1 parent 43258e5 commit 00ac46b

File tree

4 files changed

+26
-14
lines changed

4 files changed

+26
-14
lines changed

api/openapi.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -108173,7 +108173,7 @@ components:
108173108173
type: boolean
108174108174
description: Choices are automatically ordered alphabetically
108175108175
choices_count:
108176-
type: string
108176+
type: integer
108177108177
readOnly: true
108178108178
created:
108179108179
type: string

docs/CustomFieldChoiceSet.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ Name | Type | Description | Notes
1212
**BaseChoices** | Pointer to [**CustomFieldChoiceSetBaseChoices**](CustomFieldChoiceSetBaseChoices.md) | | [optional]
1313
**ExtraChoices** | **[][]interface{}** | |
1414
**OrderAlphabetically** | Pointer to **bool** | Choices are automatically ordered alphabetically | [optional]
15-
**ChoicesCount** | **string** | | [readonly]
15+
**ChoicesCount** | **int32** | | [readonly]
1616
**Created** | **NullableTime** | | [readonly]
1717
**LastUpdated** | **NullableTime** | | [readonly]
1818

1919
## Methods
2020

2121
### NewCustomFieldChoiceSet
2222

23-
`func NewCustomFieldChoiceSet(id int32, url string, display string, name string, extraChoices [][]interface{}, choicesCount string, created NullableTime, lastUpdated NullableTime, ) *CustomFieldChoiceSet`
23+
`func NewCustomFieldChoiceSet(id int32, url string, display string, name string, extraChoices [][]interface{}, choicesCount int32, created NullableTime, lastUpdated NullableTime, ) *CustomFieldChoiceSet`
2424

2525
NewCustomFieldChoiceSet instantiates a new CustomFieldChoiceSet object
2626
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.
212212

213213
### GetChoicesCount
214214

215-
`func (o *CustomFieldChoiceSet) GetChoicesCount() string`
215+
`func (o *CustomFieldChoiceSet) GetChoicesCount() int32`
216216

217217
GetChoicesCount returns the ChoicesCount field if non-nil, zero value otherwise.
218218

219219
### GetChoicesCountOk
220220

221-
`func (o *CustomFieldChoiceSet) GetChoicesCountOk() (*string, bool)`
221+
`func (o *CustomFieldChoiceSet) GetChoicesCountOk() (*int32, bool)`
222222

223223
GetChoicesCountOk returns a tuple with the ChoicesCount field if it's non-nil, zero value otherwise
224224
and a boolean to check if the value has been set.
225225

226226
### SetChoicesCount
227227

228-
`func (o *CustomFieldChoiceSet) SetChoicesCount(v string)`
228+
`func (o *CustomFieldChoiceSet) SetChoicesCount(v int32)`
229229

230230
SetChoicesCount sets ChoicesCount field to given value.
231231

model_custom_field_choice_set.go

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/fix-spec.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# Traverse schemas
1212
if 'components' in data and 'schemas' in data['components']:
13-
for name, schema in data['components']['schemas'].items():
13+
for component_name, schema in data['components']['schemas'].items():
1414
if 'properties' in schema:
1515
# Remove "null" item from nullable enums
1616
for name, prop in schema['properties'].items():
@@ -39,7 +39,19 @@
3939
for ntype in non_nullable_types:
4040
if ntype in schema['properties']:
4141
if schema['properties'][ntype]['format'] == 'binary':
42-
schema['properties'][ntype].pop('nullable')
42+
if 'nullable' in schema['properties'][ntype]:
43+
schema['properties'][ntype].pop('nullable')
44+
45+
change_type = {
46+
"CustomFieldChoiceSet": {
47+
"choices_count": "integer"
48+
}
49+
}
50+
51+
if component_name in change_type.keys():
52+
for propertie in change_type[component_name].keys():
53+
schema['properties'][propertie]['type'] = change_type[component_name][propertie]
54+
4355

4456
# Save the spec file
4557
with open(SPEC_PATH, 'w') as file:

0 commit comments

Comments
 (0)