From 2a68ad2a0585f17c3a61bc75b2e7cf105a77ee5f Mon Sep 17 00:00:00 2001 From: Stepan Rabotkin Date: Tue, 1 Sep 2026 22:40:43 +0300 Subject: [PATCH] fix(openapi): fold the enc_key oneOf into a single string The two string branches of enc_key carry no discriminator, so a decoder cannot tell them apart. They do not overlap, so each union becomes one string whose pattern accepts the same values. Signed-off-by: Stepan Rabotkin --- src/cmd/openapi.json | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/cmd/openapi.json b/src/cmd/openapi.json index 81538640..4dedeb29 100644 --- a/src/cmd/openapi.json +++ b/src/cmd/openapi.json @@ -103,11 +103,9 @@ "pool_name": { "type": "string", "description": "Pool name for the new image/snapshot" }, "parent": { "type": "string", "description": "Create a clone with this parent image name" }, "enc_key": { - "description": "Encryption key for the new/cloned image", - "oneOf": [ - { "type": "string", "enum": [ "", "random" ] }, - { "type": "string", "pattern": "^[0-9a-fA-F]{128}$|^vault:" } - ] + "type": "string", + "pattern": "^$|^random$|^[0-9a-fA-F]{128}$|^vault:", + "description": "Encryption key for the new/cloned image" }, "owner": { "type": "string", "description": "Set image owner" }, "owner_group": { "type": "string", "description": "Set image owner group" }, @@ -144,11 +142,9 @@ "readwrite": { "type": "boolean", "description": "Make the image read-write" }, "deleted": { "type": "boolean", "description": "Set or clear the 'deleted' flag" }, "enc_key": { - "description": "Change encryption key for the image", - "oneOf": [ - { "type": "string", "enum": [ "" ] }, - { "type": "string", "pattern": "^[0-9a-fA-F]{128}$|^vault:" } - ] + "type": "string", + "pattern": "^$|^[0-9a-fA-F]{128}$|^vault:", + "description": "Change encryption key for the image" }, "owner": { "type": "string", "description": "Set image owner" }, "owner_group": { "type": "string", "description": "Set image owner group" }, -- 2.47.3