From 2ee891ddfc647907957ab51fbf225d9c0783eeaf Mon Sep 17 00:00:00 2001 From: Lingxian Kong Date: Sun, 25 Aug 2019 21:03:17 +1200 Subject: [PATCH] Make volume type optional Without this patch, creating db instance will fail if no volume type is provided: Validation error: instance['volume']['type'] None is not of type 'string' (HTTP 400) even if `cinder_volume_type` is configured in trove config file. Change-Id: I3487e45840f72875ffd6cfb6ca75b4bbf60ab51e --- trove/common/apischema.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/trove/common/apischema.py b/trove/common/apischema.py index e714a6526d..54d4883b16 100644 --- a/trove/common/apischema.py +++ b/trove/common/apischema.py @@ -111,7 +111,13 @@ volume = { "required": ["size"], "properties": { "size": volume_size, - "type": non_empty_string + "type": { + "oneOf": [ + non_empty_string, + {"type": "null"} + ] + + } } }