From 92f5ad0f774d9703092aa9db490ccf3e4a36ab36 Mon Sep 17 00:00:00 2001 From: Maciej Kucmus Date: Wed, 23 Oct 2024 08:34:36 +0000 Subject: [PATCH] NEXT-38492 - Improve OpenAPI Schema for Criteria component --- .../AdminApi/components/schemas/Criteria.json | 493 +++++++++++++++--- .../Generator/Schema/AdminApi/paths/sync.json | 26 +- .../StoreApi/components/schemas/Criteria.json | 271 ++++------ 3 files changed, 558 insertions(+), 232 deletions(-) diff --git a/src/Core/Framework/Api/ApiDefinition/Generator/Schema/AdminApi/components/schemas/Criteria.json b/src/Core/Framework/Api/ApiDefinition/Generator/Schema/AdminApi/components/schemas/Criteria.json index ee84455666f..15ab26caced 100644 --- a/src/Core/Framework/Api/ApiDefinition/Generator/Schema/AdminApi/components/schemas/Criteria.json +++ b/src/Core/Framework/Api/ApiDefinition/Generator/Schema/AdminApi/components/schemas/Criteria.json @@ -6,7 +6,7 @@ "schemas": { "Criteria": { "type": "object", - "description": "Search parameters. For more information, see our documentation on [Search Queries](https:\/\/shopware.stoplight.io\/docs\/store-api\/docs\/concepts\/search-queries.md#structure)", + "description": "Search parameters. For more information, see our documentation on [Search Queries](https://shopware.stoplight.io/docs/store-api/docs/concepts/search-queries.md#structure)", "properties": { "page": { "description": "Search result page", @@ -17,7 +17,18 @@ "type": "integer" }, "filter": { - "$ref": "#\/components\/schemas\/CriteriaFilter" + "type": "array", + "description": "List of filters to restrict the search result. For more information, see [Search Queries > Filter](https://shopware.stoplight.io/docs/store-api/docs/concepts/search-queries.md#filter)", + "items": { + "anyOf": [ + { "$ref": "#/components/schemas/SimpleFilter" }, + { "$ref": "#/components/schemas/EqualsFilter" }, + { + "$ref": "#/components/schemas/MultiNotFilter" + }, + { "$ref": "#/components/schemas/RangeFilter" } + ] + } }, "sort": { "type": "array", @@ -35,62 +46,30 @@ "type": "boolean" } }, - "required": [ - "field" - ] + "required": ["field"] } }, "post-filter": { "type": "array", - "description": "Filters that applied without affecting aggregations. For more information, see [Search Queries > Post Filter](https:\/\/shopware.stoplight.io\/docs\/store-api\/docs\/concepts\/search-queries.md#post-filter)", + "description": "Filters that applied without affecting aggregations. For more information, see [Search Queries > Post Filter](https://shopware.stoplight.io/docs/store-api/docs/concepts/search-queries.md#post-filter)", "items": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "field": { - "type": "string" + "anyOf": [ + { "$ref": "#/components/schemas/SimpleFilter" }, + { "$ref": "#/components/schemas/EqualsFilter" }, + { + "$ref": "#/components/schemas/MultiNotFilter" }, - "value": { - "type": "string" - } - }, - "required": [ - "type", - "field", - "value" + { "$ref": "#/components/schemas/RangeFilter" } ] } }, "associations": { - "type": "object", - "description": "Used to fetch associations which are not fetched by default." + "$ref": "#/components/schemas/Associations" }, "aggregations": { "type": "array", - "description": "Used to perform aggregations on the search result. For more information, see [Search Queries > Aggregations](https:\/\/shopware.stoplight.io\/docs\/store-api\/docs\/concepts\/search-queries.md#aggregations)", "items": { - "type": "object", - "properties": { - "name": { - "description": "Give your aggregation an identifier, so you can find it easier", - "type": "string" - }, - "type": { - "description": "The type of aggregation", - "type": "string" - }, - "field": { - "description": "The field you want to aggregate over.", - "type": "string" - } - }, - "required": [ - "name", - "type", - "field" - ] + "$ref": "#/components/schemas/Aggregation" } }, "grouping": { @@ -113,36 +92,420 @@ "description": "Whether the total for the total number of hits should be determined for the search query. none = disabled total count, exact = calculate exact total amount (slow), next-pages = calculate only for next page (fast)", "type": "string", "default": "none", - "enum": [ - "none", - "exact", - "next-pages" - ] - } + "enum": ["none", "exact", "next-pages"] + }, + "ids": { + "type": "array", + "description": "List of ids to search for", + "items": { "type": "string" } + }, + "includes": { "$ref": "#/components/schemas/Includes" } + } + }, + "Includes": { + "description": "Specify the fields that should be returned for the given entities. Object key needs to be the entity name, and the list of fields needs to be the value. Note that the include fields will only be stripped on the API-Level, consider using the `fields` parameter for performance reasons.", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { "type": "string" } } }, - "CriteriaFilter": { + "Filters": { "type": "array", - "description": "List of filters to restrict the search result. For more information, see [Search Queries > Filter](https:\/\/shopware.stoplight.io\/docs\/store-api\/docs\/concepts\/search-queries.md#filter)", "items": { - "type": "object", - "properties": { - "type": { - "type": "string" + "anyOf": [ + { "$ref": "#/components/schemas/SimpleFilter" }, + { "$ref": "#/components/schemas/EqualsFilter" }, + { "$ref": "#/components/schemas/MultiNotFilter" }, + { "$ref": "#/components/schemas/RangeFilter" } + ] + } + }, + "SimpleFilter": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "contains", + "equalsAny", + "prefix", + "suffix" + ] + }, + "field": { "type": "string" }, + "value": { "type": "string" } }, - "field": { - "type": "string" + "required": ["type", "field", "value"] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["equalsAny", "equalsAll"] + }, + "field": { "type": "string" }, + "value": { + "type": "array", + "items": { + "type": "string" + } + } }, - "value": { - "type": "string" + "required": ["type", "field", "value"] + } + ] + }, + "EqualsFilter": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["equals"] }, + "field": { "type": "string" }, + "value": { + "oneOf": [ + { "type": "string" }, + { "type": "number" }, + { "type": "boolean" }, + { "type": "null" } + ] + } + }, + "required": ["type", "field", "value"] + }, + "MultiNotFilter": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["multi", "not"] }, + "operator": { + "type": "string", + "enum": ["and", "or", "nor", "nand"] + }, + "queries": { "$ref": "#/components/schemas/Filters" } + }, + "required": ["type", "queries"] + }, + "RangeFilter": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["range"] }, + "field": { "type": "string" }, + "parameters": { + "type": "object", + "properties": { + "gte": { + "anyOf": [ + { "type": "number" }, + { "type": "string" } + ] + }, + "gt": { + "anyOf": [ + { "type": "number" }, + { "type": "string" } + ] + }, + "lte": { + "anyOf": [ + { "type": "number" }, + { "type": "string" } + ] + }, + "lt": { + "anyOf": [ + { "type": "number" }, + { "type": "string" } + ] + } } + } + }, + "required": ["type", "field", "parameters"] + }, + "Sort": { + "type": "object", + "properties": { + "field": { "type": "string" }, + "order": { "type": "string", "enum": ["ASC", "DESC"] }, + "naturalSorting": { "type": "boolean" }, + "type": { "type": "string" } + }, + "required": ["field", "order"] + }, + "Associations": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Criteria" + } + }, + "Aggregation": { + "anyOf": [ + { "$ref": "#/components/schemas/AggregationMetrics" }, + { + "title": "AggregationEntity", + "allOf": [ + { + "$ref": "#/components/schemas/AggregationEntity" + }, + { + "$ref": "#/components/schemas/SubAggregations" + } + ] }, - "required": [ - "type", - "field", - "value" - ] + { + "title": "AggregationFilter", + "allOf": [ + { + "$ref": "#/components/schemas/AggregationFilter" + }, + { + "$ref": "#/components/schemas/SubAggregations" + } + ] + }, + { + "title": "AggregationTerms", + "allOf": [ + { + "$ref": "#/components/schemas/AggregationTerms" + }, + { + "$ref": "#/components/schemas/SubAggregations" + } + ] + }, + { + "title": "AggregationHistogram", + "allOf": [ + { + "$ref": "#/components/schemas/AggregationHistogram" + }, + { + "$ref": "#/components/schemas/SubAggregations" + } + ] + }, + { + "title": "AggregationRange", + "allOf": [ + { + "$ref": "#/components/schemas/AggregationRange" + }, + { + "$ref": "#/components/schemas/SubAggregations" + } + ] + } + ] + }, + "SubAggregations": { + "type": "object", + "properties": { + "aggregation": { + "anyOf": [ + { + "$ref": "#/components/schemas/AggregationMetrics" + }, + { + "$ref": "#/components/schemas/AggregationEntity" + }, + { + "$ref": "#/components/schemas/AggregationFilter" + }, + { "$ref": "#/components/schemas/AggregationTerms" }, + { + "$ref": "#/components/schemas/AggregationHistogram" + }, + { "$ref": "#/components/schemas/AggregationRange" } + ] + } } + }, + "AggregationEntity": { + "title": "AggregationEntity", + "type": "object", + "properties": { + "name": { + "description": "Give your aggregation an identifier, so you can find it easier", + "type": "string" + }, + "type": { + "description": "The type of aggregation", + "type": "string", + "enum": ["entity"] + }, + "field": { + "description": "The field you want to aggregate over.", + "type": "string" + }, + "definition": { + "description": "The entity definition e.g \"product_manufacturer\".", + "type": "string" + } + }, + "required": ["name", "type", "field", "definition"] + }, + "AggregationFilter": { + "title": "AggregationFilter", + "type": "object", + "properties": { + "name": { + "description": "Give your aggregation an identifier, so you can find it easier", + "type": "string" + }, + "type": { + "description": "The type of aggregation", + "type": "string", + "enum": ["filter"] + }, + "filter": { + "type": "array", + "items": { "$ref": "#/components/schemas/Filters" } + } + }, + "required": ["name", "type", "filter"] + }, + "AggregationTerms": { + "title": "AggregationTerms", + "type": "object", + "properties": { + "name": { + "description": "Give your aggregation an identifier, so you can find it easier", + "type": "string" + }, + "type": { + "description": "The type of aggregation", + "type": "string", + "enum": ["terms"] + }, + "field": { + "description": "The field you want to aggregate over.", + "type": "string" + }, + "limit": { + "description": "The number of terms to return", + "type": "number" + }, + "sort": { + "type": "array", + "description": "Sorting the aggregation result.", + "items": { "$ref": "#/components/schemas/Sort" } + } + }, + "required": ["name", "type", "field"] + }, + "AggregationHistogram": { + "title": "AggregationHistogram", + "type": "object", + "properties": { + "name": { + "description": "Give your aggregation an identifier, so you can find it easier", + "type": "string" + }, + "type": { + "description": "The type of aggregation", + "type": "string", + "enum": ["histogram"] + }, + "field": { + "description": "The field you want to aggregate over.", + "type": "string" + }, + "interval": { + "description": "The interval of the histogram", + "type": "number" + }, + "format": { + "description": "The format of the histogram", + "type": "string" + }, + "timeZone": { + "description": "The timezone of the histogram", + "type": "string" + } + }, + "required": ["name", "type", "field"] + }, + "AggregationRange": { + "title": "AggregationRange", + "description": "For more information, see [Aggregations Reference > Range Aggregation](https://developer.shopware.com/docs/resources/references/core-reference/dal-reference/aggregations-reference.html#range-aggregations)", + "type": "object", + "properties": { + "name": { + "description": "Give your aggregation an identifier, so you can find it easier", + "type": "string" + }, + "type": { + "description": "The type of aggregation", + "type": "string", + "enum": ["range"] + }, + "field": { + "description": "The field you want to aggregate over.", + "type": "string" + }, + "ranges": { + "description": "The ranges of the aggregation", + "type": "array", + "items": { + "type": "object", + "anyOf": [ + { + "type": "object", + "title": "From and to", + "properties": { + "from": { + "type": "number", + "description": "The lower bound of the range" + }, + "to": { + "type": "number", + "description": "The upper bound of the range" + } + }, + "required": ["from", "to"] + }, + { + "type": "object", + "title": "From only", + "properties": { + "from": { + "type": "string", + "description": "The lower bound of the range" + } + }, + "required": ["from"] + }, + { + "type": "object", + "title": "To only", + "properties": { + "to": { + "type": "string", + "description": "The upper bound of the range" + } + }, + "required": ["to"] + } + ] + } + } + }, + "required": ["name", "type", "field", "ranges"] + }, + "AggregationMetrics": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "type": { + "type": "string", + "enum": ["avg", "count", "max", "min", "stats", "sum"] + }, + "field": { "type": "string" } + }, + "required": ["name", "type", "field"] } } } diff --git a/src/Core/Framework/Api/ApiDefinition/Generator/Schema/AdminApi/paths/sync.json b/src/Core/Framework/Api/ApiDefinition/Generator/Schema/AdminApi/paths/sync.json index c7182748dd0..5533f82ce2a 100644 --- a/src/Core/Framework/Api/ApiDefinition/Generator/Schema/AdminApi/paths/sync.json +++ b/src/Core/Framework/Api/ApiDefinition/Generator/Schema/AdminApi/paths/sync.json @@ -67,14 +67,24 @@ } }, "filter": { - "allOf": [ - { - "$ref": "#\/components\/schemas\/CriteriaFilter" - }, - { - "description": "Only for delete operations: Instead of providing IDs in the payload, the filter by which should be deleted can be provided directly." - } - ] + "description": "Only for delete operations: Instead of providing IDs in the payload, the filter by which should be deleted can be provided directly.", + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/SimpleFilter" + }, + { + "$ref": "#/components/schemas/EqualsFilter" + }, + { + "$ref": "#/components/schemas/MultiNotFilter" + }, + { + "$ref": "#/components/schemas/RangeFilter" + } + ] + } } }, "type": "object" diff --git a/src/Core/Framework/Api/ApiDefinition/Generator/Schema/StoreApi/components/schemas/Criteria.json b/src/Core/Framework/Api/ApiDefinition/Generator/Schema/StoreApi/components/schemas/Criteria.json index a68046c2d3e..88d47b84308 100644 --- a/src/Core/Framework/Api/ApiDefinition/Generator/Schema/StoreApi/components/schemas/Criteria.json +++ b/src/Core/Framework/Api/ApiDefinition/Generator/Schema/StoreApi/components/schemas/Criteria.json @@ -6,7 +6,7 @@ "schemas": { "Criteria": { "type": "object", - "description": "Search parameters. For more information, see our documentation on [Search Queries](https:\/\/shopware.stoplight.io\/docs\/store-api\/docs\/concepts\/search-queries.md#structure)", + "description": "Search parameters. For more information, see our documentation on [Search Queries](https://shopware.stoplight.io/docs/store-api/docs/concepts/search-queries.md#structure)", "properties": { "page": { "description": "Search result page", @@ -22,20 +22,20 @@ }, "filter": { "type": "array", - "description": "List of filters to restrict the search result. For more information, see [Search Queries > Filter](https:\/\/shopware.stoplight.io\/docs\/store-api\/docs\/concepts\/search-queries.md#filter)", + "description": "List of filters to restrict the search result. For more information, see [Search Queries > Filter](https://shopware.stoplight.io/docs/store-api/docs/concepts/search-queries.md#filter)", "items": { "anyOf": [ { - "$ref": "#\/components\/schemas\/SimpleFilter" + "$ref": "#/components/schemas/SimpleFilter" }, { - "$ref": "#\/components\/schemas\/EqualsFilter" + "$ref": "#/components/schemas/EqualsFilter" }, { - "$ref": "#\/components\/schemas\/MultiNotFilter" + "$ref": "#/components/schemas/MultiNotFilter" }, { - "$ref": "#\/components\/schemas\/RangeFilter" + "$ref": "#/components/schemas/RangeFilter" } ] } @@ -49,34 +49,30 @@ }, "query": { "type": "array", - "description": "List of queries to restrict the search result. For more information, see [Search Queries > Query](https:\/\/shopware.stoplight.io\/docs\/store-api\/docs\/concepts\/search-queries.md#query)", + "description": "List of queries to restrict the search result. For more information, see [Search Queries > Query](https://shopware.stoplight.io/docs/store-api/docs/concepts/search-queries.md#query)", "items": { - "$ref": "#\/components\/schemas\/Query" + "$ref": "#/components/schemas/Query" } }, "associations": { - "type": "array", - "description": "Associations to include. For more information, see [Search Queries > Associations](https:\/\/shopware.stoplight.io\/docs\/store-api\/cf710bf73d0cd-search-queries#associations)", - "items": { - "$ref": "#\/components\/schemas\/Association" - } + "$ref": "#/components/schemas/Associations" }, "post-filter": { "type": "array", - "description": "Filters that applied without affecting aggregations. For more information, see [Search Queries > Post Filter](https:\/\/shopware.stoplight.io\/docs\/store-api\/docs\/concepts\/search-queries.md#post-filter)", + "description": "Filters that applied without affecting aggregations. For more information, see [Search Queries > Post Filter](https://shopware.stoplight.io/docs/store-api/docs/concepts/search-queries.md#post-filter)", "items": { "anyOf": [ { - "$ref": "#\/components\/schemas\/SimpleFilter" + "$ref": "#/components/schemas/SimpleFilter" }, { - "$ref": "#\/components\/schemas\/EqualsFilter" + "$ref": "#/components/schemas/EqualsFilter" }, { - "$ref": "#\/components\/schemas\/MultiNotFilter" + "$ref": "#/components/schemas/MultiNotFilter" }, { - "$ref": "#\/components\/schemas\/RangeFilter" + "$ref": "#/components/schemas/RangeFilter" } ] } @@ -85,11 +81,14 @@ "type": "array", "description": "Sorting in the search result.", "items": { - "$ref": "#\/components\/schemas\/Sort" + "$ref": "#/components/schemas/Sort" } }, "aggregations": { - "$ref": "#\/components\/schemas\/Aggregations" + "type": "array", + "items": { + "$ref": "#/components/schemas/Aggregation" + } }, "fields": { "type": "array", @@ -108,20 +107,20 @@ } }, "total-count-mode": { - "$ref": "#\/components\/schemas\/TotalCountMode" + "$ref": "#/components/schemas/TotalCountMode" }, "includes": { - "$ref": "#\/components\/schemas\/Include" + "$ref": "#/components/schemas/Includes" } } }, - "Association": { + "Associations": { "type": "object", "additionalProperties": { - "$ref": "#\/components\/schemas\/Criteria" + "$ref": "#/components/schemas/Criteria" } }, - "Include": { + "Includes": { "type": "object", "additionalProperties": { "type": "array", @@ -130,70 +129,67 @@ } } }, - "Aggregations": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#\/components\/schemas\/AggregationMetrics" - }, - { - "title": "AggregationEntity", - "allOf": [ - { - "$ref": "#\/components\/schemas\/AggregationEntity" - }, - { - "$ref": "#\/components\/schemas\/SubAggregations" - } - ] - }, - { - "title": "AggregationFilter", - "allOf": [ - { - "$ref": "#\/components\/schemas\/AggregationFilter" - }, - { - "$ref": "#\/components\/schemas\/SubAggregations" - } - ] - }, - { - "title": "AggregationTerms", - "allOf": [ - { - "$ref": "#\/components\/schemas\/AggregationTerms" - }, - { - "$ref": "#\/components\/schemas\/SubAggregations" - } - ] - }, - { - "title": "AggregationHistogram", - "allOf": [ - { - "$ref": "#\/components\/schemas\/AggregationHistogram" - }, - { - "$ref": "#\/components\/schemas\/SubAggregations" - } - ] - }, - { - "title": "AggregationRange", - "allOf": [ - { - "$ref": "#\/components\/schemas\/AggregationRange" - }, - { - "$ref": "#\/components\/schemas\/SubAggregations" - } - ] - } - ] - } + "Aggregation": { + "anyOf": [ + { + "$ref": "#/components/schemas/AggregationMetrics" + }, + { + "title": "AggregationEntity", + "allOf": [ + { + "$ref": "#/components/schemas/AggregationEntity" + }, + { + "$ref": "#/components/schemas/SubAggregations" + } + ] + }, + { + "title": "AggregationFilter", + "allOf": [ + { + "$ref": "#/components/schemas/AggregationFilter" + }, + { + "$ref": "#/components/schemas/SubAggregations" + } + ] + }, + { + "title": "AggregationTerms", + "allOf": [ + { + "$ref": "#/components/schemas/AggregationTerms" + }, + { + "$ref": "#/components/schemas/SubAggregations" + } + ] + }, + { + "title": "AggregationHistogram", + "allOf": [ + { + "$ref": "#/components/schemas/AggregationHistogram" + }, + { + "$ref": "#/components/schemas/SubAggregations" + } + ] + }, + { + "title": "AggregationRange", + "allOf": [ + { + "$ref": "#/components/schemas/AggregationRange" + }, + { + "$ref": "#/components/schemas/SubAggregations" + } + ] + } + ] }, "SubAggregations": { "type": "object", @@ -201,22 +197,22 @@ "aggregation": { "anyOf": [ { - "$ref": "#\/components\/schemas\/AggregationMetrics" + "$ref": "#/components/schemas/AggregationMetrics" }, { - "$ref": "#\/components\/schemas\/AggregationEntity" + "$ref": "#/components/schemas/AggregationEntity" }, { - "$ref": "#\/components\/schemas\/AggregationFilter" + "$ref": "#/components/schemas/AggregationFilter" }, { - "$ref": "#\/components\/schemas\/AggregationTerms" + "$ref": "#/components/schemas/AggregationTerms" }, { - "$ref": "#\/components\/schemas\/AggregationHistogram" + "$ref": "#/components/schemas/AggregationHistogram" }, { - "$ref": "#\/components\/schemas\/AggregationRange" + "$ref": "#/components/schemas/AggregationRange" } ] } @@ -226,11 +222,7 @@ "description": "Whether the total for the total number of hits should be determined for the search query. none = disabled total count, exact = calculate exact total amount (slow), next-pages = calculate only for next page (fast)", "type": "string", "default": "none", - "enum": [ - "none", - "exact", - "next-pages" - ] + "enum": ["none", "exact", "next-pages"] }, "Query": { "type": "object", @@ -241,16 +233,16 @@ "query": { "oneOf": [ { - "$ref": "#\/components\/schemas\/SimpleFilter" + "$ref": "#/components/schemas/SimpleFilter" }, { - "$ref": "#\/components\/schemas\/EqualsFilter" + "$ref": "#/components/schemas/EqualsFilter" }, { - "$ref": "#\/components\/schemas\/MultiNotFilter" + "$ref": "#/components/schemas/MultiNotFilter" }, { - "$ref": "#\/components\/schemas\/RangeFilter" + "$ref": "#/components/schemas/RangeFilter" } ] } @@ -265,10 +257,7 @@ }, "order": { "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "enum": ["ASC", "DESC"] }, "naturalSorting": { "type": "boolean" @@ -277,26 +266,23 @@ "type": "string" } }, - "required": [ - "field", - "order" - ] + "required": ["field", "order"] }, "Filters": { "type": "array", "items": { "anyOf": [ { - "$ref": "#\/components\/schemas\/SimpleFilter" + "$ref": "#/components/schemas/SimpleFilter" }, { - "$ref": "#\/components\/schemas\/EqualsFilter" + "$ref": "#/components/schemas/EqualsFilter" }, { - "$ref": "#\/components\/schemas\/MultiNotFilter" + "$ref": "#/components/schemas/MultiNotFilter" }, { - "$ref": "#\/components\/schemas\/RangeFilter" + "$ref": "#/components/schemas/RangeFilter" } ] } @@ -306,12 +292,7 @@ "properties": { "type": { "type": "string", - "enum": [ - "contains", - "equalsAny", - "prefix", - "suffix" - ] + "enum": ["contains", "equalsAny", "prefix", "suffix"] }, "field": { "type": "string" @@ -320,20 +301,14 @@ "type": "string" } }, - "required": [ - "type", - "field", - "value" - ] + "required": ["type", "field", "value"] }, "EqualsFilter": { "type": "object", "properties": { "type": { "type": "string", - "enum": [ - "equals" - ] + "enum": ["equals"] }, "field": { "type": "string" @@ -355,49 +330,31 @@ ] } }, - "required": [ - "type", - "field", - "value" - ] + "required": ["type", "field", "value"] }, "MultiNotFilter": { "type": "object", "properties": { "type": { "type": "string", - "enum": [ - "multi", - "not" - ] + "enum": ["multi", "not"] }, "operator": { "type": "string", - "enum": [ - "AND", - "and", - "OR", - "or" - ] + "enum": ["and", "or", "nor", "nand"] }, "queries": { - "$ref": "#\/components\/schemas\/Filters" + "$ref": "#/components/schemas/Filters" } }, - "required": [ - "type", - "operator", - "queries" - ] + "required": ["type", "operator", "queries"] }, "RangeFilter": { "type": "object", "properties": { "type": { "type": "string", - "enum": [ - "range" - ] + "enum": ["range"] }, "field": { "type": "string" @@ -420,11 +377,7 @@ } } }, - "required": [ - "type", - "field", - "parameters" - ] + "required": ["type", "field", "parameters"] } } }