Merge "OpenAPI: Fix arrays without items"

This commit is contained in:
Zuul
2025年07月17日 15:48:58 +00:00
committed by Gerrit Code Review

View File

@@ -1217,18 +1217,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,

View File

@@ -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."",

View File

@@ -21,7 +21,7 @@ LIMITS_SCHEMA: dict[str, Any] = {
"limits": {
"type": "object",
"properties": {
"rate": {"type": "array"},
"rate": {"type": "array", "items": {}},
"absolute": {
"type": "object",
"properties": {
Reference in New Issue
openstack/codegenerator
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.