From e634ecbe11fcad6865d2500b314ed94a2ce1a43d Mon Sep 17 00:00:00 2001 From: Artem Goncharov Date: Sat, 20 Apr 2024 11:42:20 +0200 Subject: [PATCH] fix volume.limit schema "type: int64" is wrong and "format: int64" was meant instead Also ensure operation_type is selected as "show" instead of "list" in the metadata since it returns object and not list. Change-Id: I243c74094a000ecf61edab998ae01ad432ab889e --- codegenerator/metadata.py | 4 ++++ codegenerator/openapi/cinder_schemas/limit.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/codegenerator/metadata.py b/codegenerator/metadata.py index 33307f8..465b368 100644 --- a/codegenerator/metadata.py +++ b/codegenerator/metadata.py @@ -932,6 +932,10 @@ def post_process_block_storage_operation( "rust-cli" ].cli_full_command.replace("show", "check") + if resource_name == "limit" and operation_name == "list": + # Limits API return object and not a list + operation.targets["rust-cli"].operation_type = "show" + if operation_name == "delete_all": operation.targets["rust-cli"].cli_full_command = operation.targets[ "rust-cli" diff --git a/codegenerator/openapi/cinder_schemas/limit.py b/codegenerator/openapi/cinder_schemas/limit.py index c1f3974..3680de5 100644 --- a/codegenerator/openapi/cinder_schemas/limit.py +++ b/codegenerator/openapi/cinder_schemas/limit.py @@ -35,7 +35,7 @@ LIMITS_SCHEMA: dict[str, Any] = { }, "maxTotalVolumeGigabytes": { "type": "integer", - "type": "int64", + "format": "int64", "description": "The maximum total amount of volumes, in gibibytes (GiB).", }, "maxTotalSnapshots": { @@ -44,7 +44,7 @@ LIMITS_SCHEMA: dict[str, Any] = { }, "maxTotalBackupGigabytes": { "type": "integer", - "type": "int64", + "format": "int64", "description": "The maximum total amount of backups, in gibibytes (GiB).", }, "totalBackupGigabytesUsed": {