diff --git a/codegenerator/openapi/base.py b/codegenerator/openapi/base.py index 0ed7de2..c1ee83f 100644 --- a/codegenerator/openapi/base.py +++ b/codegenerator/openapi/base.py @@ -1208,18 +1208,18 @@ class OpenStackServerSourceBase: typ = v.get("type") if typ == "object": schema.properties[k] = self._sanitize_schema(v) - if typ == "array" and "additionalItems" in v: - # additionalItems have nothing to do under the type array (create servergroup) - schema.properties[k].pop("additionalItems") - if ( - typ == "array" - and "items" in v - and isinstance(v["items"], list) - ): - # server_group create - type array "items" is a dict and not list - # NOTE: server_groups recently changed to "prefixItems", - # so this may be not necessary anymore - schema.properties[k]["items"] = v["items"][0] + if typ == "array": + if "additionalItems" in v: + # additionalItems have nothing to do under the type array (create servergroup) + schema.properties[k].pop("additionalItems") + # Arrays must always have 'items' + if "items" not in v: + schema.properties[k]["items"] = {} + elif isinstance(v["items"], list): + # server_group create - type array "items" is a dict and not list + # NOTE: server_groups recently changed to "prefixItems", + # so this may be not necessary anymore + schema.properties[k]["items"] = v["items"][0] if start_version and self._api_ver_major(start_version) not in [ "0", 0, diff --git a/codegenerator/openapi/cinder_schemas/extension.py b/codegenerator/openapi/cinder_schemas/extension.py index 8a9e709..b22eb72 100644 --- a/codegenerator/openapi/cinder_schemas/extension.py +++ b/codegenerator/openapi/cinder_schemas/extension.py @@ -27,7 +27,7 @@ EXTENSION_SCHEMA: dict[str, Any] = { "type": "string", "description": "The extension description.", }, - "links": {"type": "array", "description": ""}, + "links": {"type": "array", "description": "", "items": {}}, "alias": { "type": "string", "description": "The alias for the extension. For example, “FOXNSOX”, “os- availability-zone”, “os-extended-quotas”, “os- share-unmanage” or “os-used-limits.”", diff --git a/codegenerator/openapi/cinder_schemas/limit.py b/codegenerator/openapi/cinder_schemas/limit.py index 2e336c3..39ac556 100644 --- a/codegenerator/openapi/cinder_schemas/limit.py +++ b/codegenerator/openapi/cinder_schemas/limit.py @@ -21,7 +21,7 @@ LIMITS_SCHEMA: dict[str, Any] = { "limits": { "type": "object", "properties": { - "rate": {"type": "array"}, + "rate": {"type": "array", "items": {}}, "absolute": { "type": "object", "properties": {