From d47d27c70b7bdb4f2d63d260daa05b20c85c4117 Mon Sep 17 00:00:00 2001 From: xuxuepeng Date: Thu, 7 Nov 2024 14:46:01 +0800 Subject: [PATCH 24/25] Use any type instead of bytearray Signed-off-by: xuxuepeng --- src/json/schema/defs.json | 35 +++++++++---------- src/json/schema/sandbox/create-request.json | 5 +-- src/json/schema/sandbox/metrics-response.json | 5 +-- src/json/schema/sandbox/sandbox.json | 12 ++----- src/json/schema/sandbox/status-response.json | 5 +-- 5 files changed, 22 insertions(+), 40 deletions(-) diff --git a/src/json/schema/defs.json b/src/json/schema/defs.json index 854a816..b313103 100644 --- a/src/json/schema/defs.json +++ b/src/json/schema/defs.json @@ -226,6 +226,20 @@ "type": "string" } }, + "any": { + "type": "object", + "properties": { + "type_url": { + "type": "string" + }, + "value": { + "type": "array", + "items": { + "type": "byte" + } + } + } + }, "mapStringString": { "type": "object", "patternProperties": { @@ -406,17 +420,14 @@ } } }, - "mapStringObjectByteArray": { + "mapStringObjectAny": { "type": "object", "patternProperties": { ".{1,}": { "type": "object", "properties": { "Element": { - "type": "array", - "items": { - "type": "byte" - } + "$ref": "#/definitions/any" } } } @@ -498,20 +509,6 @@ } } }, - "any": { - "type": "object", - "properties": { - "type_url": { - "type": "string" - }, - "value": { - "type": "array", - "items": { - "type": "byte" - } - } - } - }, "zone": { "type": "object", "properties": { diff --git a/src/json/schema/sandbox/create-request.json b/src/json/schema/sandbox/create-request.json index 2e5a06d..27accf6 100644 --- a/src/json/schema/sandbox/create-request.json +++ b/src/json/schema/sandbox/create-request.json @@ -12,10 +12,7 @@ } }, "options": { - "type": "array", - "items": { - "type": "byte" - } + "$ref": "../defs.json#/definitions/any" }, "netns_path": { "type": "string" diff --git a/src/json/schema/sandbox/metrics-response.json b/src/json/schema/sandbox/metrics-response.json index b0a255d..53afd1f 100644 --- a/src/json/schema/sandbox/metrics-response.json +++ b/src/json/schema/sandbox/metrics-response.json @@ -9,10 +9,7 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "byte" - } + "$ref": "../defs.json#/definitions/any" } } } diff --git a/src/json/schema/sandbox/sandbox.json b/src/json/schema/sandbox/sandbox.json index 786ac1f..9725a30 100644 --- a/src/json/schema/sandbox/sandbox.json +++ b/src/json/schema/sandbox/sandbox.json @@ -12,18 +12,12 @@ "type": "string" }, "options": { - "type": "array", - "items": { - "type": "byte" - } + "$ref": "../defs.json#/definitions/any" } } }, "spec": { - "type": "array", - "items": { - "type": "byte" - } + "$ref": "../defs.json#/definitions/any" }, "labels": { "$ref": "../defs.json#/definitions/mapStringString" @@ -35,7 +29,7 @@ "type": "uint64" }, "extensions": { - "$ref": "../defs.json#/definitions/mapStringObjectByteArray" + "$ref": "../defs.json#/definitions/mapStringObjectAny" }, "sandboxer": { "type": "string" diff --git a/src/json/schema/sandbox/status-response.json b/src/json/schema/sandbox/status-response.json index 779a35d..efac831 100644 --- a/src/json/schema/sandbox/status-response.json +++ b/src/json/schema/sandbox/status-response.json @@ -21,10 +21,7 @@ "type": "uint64" }, "extra": { - "type": "array", - "items": { - "type": "byte" - } + "$ref": "../defs.json#/definitions/any" }, "address": { "type": "string" -- 2.34.1