Skip to content

Commit 8773ca9

Browse files
committed
Fix "primary_ip" nullable type.
1 parent 97dbb8f commit 8773ca9

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

api/openapi.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -98504,6 +98504,7 @@ components:
9850498504
allOf:
9850598505
- $ref: '#/components/schemas/NestedIPAddress'
9850698506
readOnly: true
98507+
nullable: true
9850798508
primary_ip4:
9850898509
allOf:
9850998510
- $ref: '#/components/schemas/NestedIPAddress'
@@ -99406,6 +99407,7 @@ components:
9940699407
allOf:
9940799408
- $ref: '#/components/schemas/NestedIPAddress'
9940899409
readOnly: true
99410+
nullable: true
9940999411
primary_ip4:
9941099412
allOf:
9941199413
- $ref: '#/components/schemas/NestedIPAddress'
@@ -131389,6 +131391,7 @@ components:
131389131391
allOf:
131390131392
- $ref: '#/components/schemas/NestedIPAddress'
131391131393
readOnly: true
131394+
nullable: true
131392131395
primary_ip4:
131393131396
allOf:
131394131397
- $ref: '#/components/schemas/NestedIPAddress'

scripts/fix-spec.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,15 @@
1919
if 'properties' in prop and 'value' in prop['properties'] and 'enum' in prop['properties']['value'] and None in prop['properties']['value']['enum']:
2020
prop['properties']['value']['enum'].remove(None)
2121

22-
# Fix "parent_device" nullable type
23-
if 'parent_device' in schema['properties']:
24-
schema['properties']['parent_device']['nullable'] = True
22+
# Fix nullable types
23+
nullable_types = [
24+
'parent_device',
25+
'primary_ip',
26+
]
27+
28+
for ntype in nullable_types:
29+
if ntype in schema['properties']:
30+
schema['properties'][ntype]['nullable'] = True
2531

2632
# Save the spec file
2733
with open(SPEC_PATH, 'w') as file:

0 commit comments

Comments
 (0)