Address explicit nullable types in network

Some conversion schemes missed explicit null support.

Change-Id: I01ed16f2690c78492a0d8673ad86f67de92c80ae
This commit is contained in:
Artem Goncharov
2025-05-13 08:11:52 +02:00
parent 2c5a228684
commit 8a10a63394

View File

@@ -1345,7 +1345,7 @@ def get_schema(param_data):
elif "type:list_of_any_key_specs_or_none" in schema_data:
logging.warning("TODO: Implement type:list_of_any_key_specs_or_none")
schema = {
"type": "array",
"type": ["array", "null"],
"items": {"type": "object", "extraProperties": True},
"x-openstack": {"todo": "implementme"},
}
@@ -1356,7 +1356,7 @@ def get_schema(param_data):
elif "type:ip_address" in schema_data:
schema = {"type": "string"}
elif "type:ip_address_or_none" in schema_data:
schema = {"type": "string"}
schema = {"type": ["string", "null"]}
elif "type:subnet_or_none" in schema_data:
schema = {"type": ["string", "null"]}
elif "type:fip_dns_host_name" in schema_data:
@@ -1407,7 +1407,7 @@ def get_schema(param_data):
elif "type:dict_or_empty" in schema_data:
schema = get_schema(schema_data["type:dict_or_empty"])
elif "type:list_of_subnets_or_none" in schema_data:
schema = {"type": "array", "items": {"type": "string"}}
schema = {"type": ["array", "null"], "items": {"type": "string"}}
if convert_to:
# Nice way to get type of the field, isn't it?
if convert_to.__name__ == "convert_to_boolean":