From ca9d1087413b811b78d4a6efd74f4da064817592 Mon Sep 17 00:00:00 2001 From: Pranav Raj S Date: Fri, 2 Jun 2023 15:36:41 -0700 Subject: [PATCH] fix: Update documentation of filter APIs (#7245) --- swagger/paths/application/contacts/filter.yml | 63 +++--- .../paths/application/conversation/filter.yml | 63 +++--- swagger/swagger.json | 214 +++++++++--------- 3 files changed, 178 insertions(+), 162 deletions(-) diff --git a/swagger/paths/application/contacts/filter.yml b/swagger/paths/application/contacts/filter.yml index 39aa269d9..639784ea5 100644 --- a/swagger/paths/application/contacts/filter.yml +++ b/swagger/paths/application/contacts/filter.yml @@ -10,39 +10,42 @@ parameters: - name: page in: query type: integer - - name: payload + - name: body in: body required: true schema: - type: array - items: - type: object - properties: - attribute_key: - type: string - description: filter attribute name - filter_operator: - type: string - description: filter operator name - enum: [ equal_to, not_equal_to, contains, does_not_contain ] - values: - type: array - items: - type: string - description: array of the attribute values to filter - query_operator: - type: string - description: query operator name - enum: [ AND, OR ] - example: - - attribute_key: 'name' - filter_operator: 'equal_to' - values: ['en'] - query_operator: 'AND' - - attribute_key: 'country_code' - filter_operator: 'equal_to' - values: ['us'] - query_operator: nil + type: object + properties: + payload: + type: array + items: + type: object + properties: + attribute_key: + type: string + description: filter attribute name + filter_operator: + type: string + description: filter operator name + enum: [ equal_to, not_equal_to, contains, does_not_contain ] + values: + type: array + items: + type: string + description: array of the attribute values to filter + query_operator: + type: string + description: query operator name + enum: [ AND, OR ] + example: + - attribute_key: 'name' + filter_operator: 'equal_to' + values: ['en'] + query_operator: 'AND' + - attribute_key: 'country_code' + filter_operator: 'equal_to' + values: ['us'] + query_operator: null responses: 200: diff --git a/swagger/paths/application/conversation/filter.yml b/swagger/paths/application/conversation/filter.yml index 3ef141145..4ee5f5d54 100644 --- a/swagger/paths/application/conversation/filter.yml +++ b/swagger/paths/application/conversation/filter.yml @@ -10,39 +10,42 @@ parameters: - name: page in: query type: integer - - name: payload + - name: body in: body required: true schema: - type: array - items: - type: object - properties: - attribute_key: - type: string - description: filter attribute name - filter_operator: - type: string - description: filter operator name - enum: [ equal_to, not_equal_to, contains, does_not_contain ] - values: - type: array - items: - type: string - description: array of the attribute values to filter - query_operator: - type: string - description: query operator name - enum: [ AND, OR ] - example: - - attribute_key: 'browser_language' - filter_operator: 'not_eq' - values: ['en'] - query_operator: 'AND' - - attribute_key: 'status' - filter_operator: 'eq' - values: ['pending'] - query_operator: nil + type: object + properties: + payload: + type: array + items: + type: object + properties: + attribute_key: + type: string + description: filter attribute name + filter_operator: + type: string + description: filter operator name + enum: [ equal_to, not_equal_to, contains, does_not_contain ] + values: + type: array + items: + type: string + description: array of the attribute values to filter + query_operator: + type: string + description: query operator name + enum: [ AND, OR ] + example: + - attribute_key: 'browser_language' + filter_operator: 'not_eq' + values: ['en'] + query_operator: 'AND' + - attribute_key: 'status' + filter_operator: 'eq' + values: ['pending'] + query_operator: null responses: 200: diff --git a/swagger/swagger.json b/swagger/swagger.json index c6583cb1e..bf39397a6 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -2014,63 +2014,68 @@ "type": "integer" }, { - "name": "payload", + "name": "body", "in": "body", "required": true, "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "attribute_key": { - "type": "string", - "description": "filter attribute name" + "type": "object", + "properties": { + "payload": { + "type": "array", + "items": { + "type": "object", + "properties": { + "attribute_key": { + "type": "string", + "description": "filter attribute name" + }, + "filter_operator": { + "type": "string", + "description": "filter operator name", + "enum": [ + "equal_to", + "not_equal_to", + "contains", + "does_not_contain" + ] + }, + "values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "array of the attribute values to filter" + }, + "query_operator": { + "type": "string", + "description": "query operator name" + }, + "enum": [ + "AND", + "OR" + ] + } }, - "filter_operator": { - "type": "string", - "description": "filter operator name", - "enum": [ - "equal_to", - "not_equal_to", - "contains", - "does_not_contain" - ] - }, - "values": { - "type": "array", - "items": { - "type": "string" + "example": [ + { + "attribute_key": "name", + "filter_operator": "equal_to", + "values": [ + "en" + ], + "query_operator": "AND" }, - "description": "array of the attribute values to filter" - }, - "query_operator": { - "type": "string", - "description": "query operator name", - "enum": [ - "AND", - "OR" - ] - } + { + "attribute_key": "country_code", + "filter_operator": "equal_to", + "values": [ + "us" + ], + "query_operator": null + } + ] } - }, - "example": [ - { - "attribute_key": "name", - "filter_operator": "equal_to", - "values": [ - "en" - ], - "query_operator": "AND" - }, - { - "attribute_key": "country_code", - "filter_operator": "equal_to", - "values": [ - "us" - ], - "query_operator": "nil" - } - ] + } } } ], @@ -2907,63 +2912,68 @@ "type": "integer" }, { - "name": "payload", + "name": "body", "in": "body", "required": true, "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "attribute_key": { - "type": "string", - "description": "filter attribute name" + "type": "object", + "properties": { + "payload": { + "type": "array", + "items": { + "type": "object", + "properties": { + "attribute_key": { + "type": "string", + "description": "filter attribute name" + }, + "filter_operator": { + "type": "string", + "description": "filter operator name", + "enum": [ + "equal_to", + "not_equal_to", + "contains", + "does_not_contain" + ] + }, + "values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "array of the attribute values to filter" + }, + "query_operator": { + "type": "string", + "description": "query operator name", + "enum": [ + "AND", + "OR" + ] + } + } }, - "filter_operator": { - "type": "string", - "description": "filter operator name", - "enum": [ - "equal_to", - "not_equal_to", - "contains", - "does_not_contain" - ] - }, - "values": { - "type": "array", - "items": { - "type": "string" + "example": [ + { + "attribute_key": "browser_language", + "filter_operator": "not_eq", + "values": [ + "en" + ], + "query_operator": "AND" }, - "description": "array of the attribute values to filter" - }, - "query_operator": { - "type": "string", - "description": "query operator name", - "enum": [ - "AND", - "OR" - ] - } + { + "attribute_key": "status", + "filter_operator": "eq", + "values": [ + "pending" + ], + "query_operator": null + } + ] } - }, - "example": [ - { - "attribute_key": "browser_language", - "filter_operator": "not_eq", - "values": [ - "en" - ], - "query_operator": "AND" - }, - { - "attribute_key": "status", - "filter_operator": "eq", - "values": [ - "pending" - ], - "query_operator": "nil" - } - ] + } } } ],