加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0024-Use-any-type-instead-of-bytearray.patch 5.05 KB
一键复制 编辑 原始数据 按行查看 历史
liuxu 提交于 2024-11-25 16:04 . lcr: sync from upstream
From d47d27c70b7bdb4f2d63d260daa05b20c85c4117 Mon Sep 17 00:00:00 2001
From: xuxuepeng <xuxuepeng1@huawei.com>
Date: Thu, 7 Nov 2024 14:46:01 +0800
Subject: [PATCH 24/25] Use any type instead of bytearray
Signed-off-by: xuxuepeng <xuxuepeng1@huawei.com>
---
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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化