From a9cb3c60d27cd8bbf938f38d5cb8d87bd0a74bba Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 25 Jan 2022 13:12:11 +0100 Subject: [PATCH 1/3] Improve definition of log filter topic JSON type --- src/schemas/filter.json | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/schemas/filter.json b/src/schemas/filter.json index 91cb40be6..b3a7a1516 100644 --- a/src/schemas/filter.json +++ b/src/schemas/filter.json @@ -52,19 +52,31 @@ }, "topics": { "title": "Topics", - "$ref": "#/components/schemas/Topics" + "$ref": "#/components/schemas/FilterTopics" } } }, - "Topic": { - "title": "Topic", - "$ref": "#/components/schemas/uint256" - }, - "Topics": { - "title": "Topics", + "FilterTopics": { + "title": "Filter Topics", "type": "array", "items": { - "$ref": "#/components/schemas/Topic" + "$ref": "#/components/schemas/FilterTopic" } + }, + "FilterTopic": { + "title": "Filter Topic List Entry", + "oneOf": [ + { + "title": "Single Topic Match", + "$ref": "#/components/schemas/bytes32" + }, + { + "title": "Multiple Topic Match", + "type": "array", + "items": { + "$ref": "#/components/schemas/bytes32" + } + } + ] } } From b5793543f21ba64c0e4e55929da0e1f3cbd64131 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 25 Jan 2022 13:27:40 +0100 Subject: [PATCH 2/3] Remove reference to Topics in Log --- src/schemas/receipt.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/schemas/receipt.json b/src/schemas/receipt.json index 4983b80b6..0497b5141 100644 --- a/src/schemas/receipt.json +++ b/src/schemas/receipt.json @@ -37,7 +37,10 @@ }, "topics": { "title": "topics", - "$ref": "#/components/schemas/Topics" + "type": "array", + "items": { + "$ref": "#/components/schemas/bytes32" + } } } }, From 3bf2cf7f2a7444cff1773d1f4ba94ef46c7aa653 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 25 Jan 2022 13:50:21 +0100 Subject: [PATCH 3/3] Filter topics can also be null --- src/schemas/filter.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/schemas/filter.json b/src/schemas/filter.json index b3a7a1516..744bba5a3 100644 --- a/src/schemas/filter.json +++ b/src/schemas/filter.json @@ -66,6 +66,10 @@ "FilterTopic": { "title": "Filter Topic List Entry", "oneOf": [ + { + "title": "Any Topic Match", + "type": "null" + }, { "title": "Single Topic Match", "$ref": "#/components/schemas/bytes32"