From 5e697cf6eb32fecb25469578cdf7d29e5fd8f3e9 Mon Sep 17 00:00:00 2001 From: Artem Goncharov Date: Thu, 17 Apr 2025 12:34:18 +0200 Subject: [PATCH] Fix BS response schemas Not all of the fields declared as mandatory are being returned by real clouds. Change-Id: I59ed1b1014a6eb91f067b61e3b57a3bb8f4e2b8e --- codegenerator/openapi/cinder_schemas/attachment.py | 2 +- codegenerator/openapi/cinder_schemas/volume.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/codegenerator/openapi/cinder_schemas/attachment.py b/codegenerator/openapi/cinder_schemas/attachment.py index 775c862..0673c08 100644 --- a/codegenerator/openapi/cinder_schemas/attachment.py +++ b/codegenerator/openapi/cinder_schemas/attachment.py @@ -57,7 +57,7 @@ ATTACHMENT_DETAIL_SCHEMA: dict[str, Any] = { "attach_mode": { "type": "string", "description": "The attach mode of attachment, read-only (‘ro’) or read-and-write (‘rw’), default is ‘rw’.", - "enum": ["ro", "rw"], + "enum": ["null", "ro", "rw"], "x-openstack": {"min-ver": "3.54"}, }, "attached_at": { diff --git a/codegenerator/openapi/cinder_schemas/volume.py b/codegenerator/openapi/cinder_schemas/volume.py index b2f102a..3267885 100644 --- a/codegenerator/openapi/cinder_schemas/volume.py +++ b/codegenerator/openapi/cinder_schemas/volume.py @@ -145,7 +145,7 @@ VOLUME_SCHEMA: dict[str, Any] = { "description": "The date and time when the resource was updated.", }, "replication_status": { - "type": "string", + "type": ["string", "null"], "description": "The volume replication status.", }, "id": { @@ -203,7 +203,6 @@ VOLUME_SCHEMA: dict[str, Any] = { "bootable", "encrypted", "id", - "migration_status", "name", "replication_status", "size",