From c346216424d6571f96d80f47a9224da4c47dbbf9 Mon Sep 17 00:00:00 2001
From: bakito <github@bakito.ch>
Date: Sat, 12 Mar 2022 12:46:15 +0100
Subject: [PATCH] correct openapi schema

---
 internal/home/controlfiltering.go |  2 +-
 openapi/openapi.yaml              | 16 +++++++---------
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/internal/home/controlfiltering.go b/internal/home/controlfiltering.go
index 639403d8..51d86146 100644
--- a/internal/home/controlfiltering.go
+++ b/internal/home/controlfiltering.go
@@ -316,7 +316,7 @@ type filterJSON struct {
 	URL         string `json:"url"`
 	Name        string `json:"name"`
 	RulesCount  uint32 `json:"rules_count"`
-	LastUpdated string `json:"last_updated"`
+	LastUpdated string `json:"last_updated,omitempty"`
 }
 
 type filteringConfig struct {
diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml
index 8b21a01f..bb3bfe09 100644
--- a/openapi/openapi.yaml
+++ b/openapi/openapi.yaml
@@ -1396,7 +1396,6 @@
       'required':
       - 'enabled'
       - 'id'
-      - 'last_updated'
       - 'name'
       - 'rules_count'
       - 'url'
@@ -1434,6 +1433,10 @@
           'type': 'array'
           'items':
             '$ref': '#/components/schemas/Filter'
+        'whitelist_filters':
+          'type': 'array'
+          'items':
+            '$ref': '#/components/schemas/Filter'
         'user_rules':
           'type': 'array'
           'items':
@@ -1451,14 +1454,7 @@
       'description': 'Filtering URL settings'
       'properties':
         'data':
-          'properties':
-            'enabled':
-              'type': 'boolean'
-            'name':
-              'type': 'string'
-            'url':
-              'type': 'string'
-          'type': 'object'
+          '$ref': '#/components/schemas/Filter'
         'url':
           'type': 'string'
         'whitelist':
@@ -1860,6 +1856,8 @@
           'description': 'Previously added URL containing filtering rules'
           'type': 'string'
           'example': 'https://filters.adtidy.org/windows/filters/15.txt'
+        'whitelist':
+          'type': 'boolean'
     'QueryLogItem':
       'type': 'object'
       'description': 'Query log item'