fix: Update documentation of filter APIs (#7245)

This commit is contained in:
Pranav Raj S 2023-06-02 15:36:41 -07:00 committed by GitHub
parent f28533bc47
commit ca9d108741
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 178 additions and 162 deletions

View File

@ -10,39 +10,42 @@ parameters:
- name: page - name: page
in: query in: query
type: integer type: integer
- name: payload - name: body
in: body in: body
required: true required: true
schema: schema:
type: array type: object
items: properties:
type: object payload:
properties: type: array
attribute_key: items:
type: string type: object
description: filter attribute name properties:
filter_operator: attribute_key:
type: string type: string
description: filter operator name description: filter attribute name
enum: [ equal_to, not_equal_to, contains, does_not_contain ] filter_operator:
values: type: string
type: array description: filter operator name
items: enum: [ equal_to, not_equal_to, contains, does_not_contain ]
type: string values:
description: array of the attribute values to filter type: array
query_operator: items:
type: string type: string
description: query operator name description: array of the attribute values to filter
enum: [ AND, OR ] query_operator:
example: type: string
- attribute_key: 'name' description: query operator name
filter_operator: 'equal_to' enum: [ AND, OR ]
values: ['en'] example:
query_operator: 'AND' - attribute_key: 'name'
- attribute_key: 'country_code' filter_operator: 'equal_to'
filter_operator: 'equal_to' values: ['en']
values: ['us'] query_operator: 'AND'
query_operator: nil - attribute_key: 'country_code'
filter_operator: 'equal_to'
values: ['us']
query_operator: null
responses: responses:
200: 200:

View File

@ -10,39 +10,42 @@ parameters:
- name: page - name: page
in: query in: query
type: integer type: integer
- name: payload - name: body
in: body in: body
required: true required: true
schema: schema:
type: array type: object
items: properties:
type: object payload:
properties: type: array
attribute_key: items:
type: string type: object
description: filter attribute name properties:
filter_operator: attribute_key:
type: string type: string
description: filter operator name description: filter attribute name
enum: [ equal_to, not_equal_to, contains, does_not_contain ] filter_operator:
values: type: string
type: array description: filter operator name
items: enum: [ equal_to, not_equal_to, contains, does_not_contain ]
type: string values:
description: array of the attribute values to filter type: array
query_operator: items:
type: string type: string
description: query operator name description: array of the attribute values to filter
enum: [ AND, OR ] query_operator:
example: type: string
- attribute_key: 'browser_language' description: query operator name
filter_operator: 'not_eq' enum: [ AND, OR ]
values: ['en'] example:
query_operator: 'AND' - attribute_key: 'browser_language'
- attribute_key: 'status' filter_operator: 'not_eq'
filter_operator: 'eq' values: ['en']
values: ['pending'] query_operator: 'AND'
query_operator: nil - attribute_key: 'status'
filter_operator: 'eq'
values: ['pending']
query_operator: null
responses: responses:
200: 200:

View File

@ -2014,63 +2014,68 @@
"type": "integer" "type": "integer"
}, },
{ {
"name": "payload", "name": "body",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"type": "array", "type": "object",
"items": { "properties": {
"type": "object", "payload": {
"properties": { "type": "array",
"attribute_key": { "items": {
"type": "string", "type": "object",
"description": "filter attribute name" "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": { "example": [
"type": "string", {
"description": "filter operator name", "attribute_key": "name",
"enum": [ "filter_operator": "equal_to",
"equal_to", "values": [
"not_equal_to", "en"
"contains", ],
"does_not_contain" "query_operator": "AND"
]
},
"values": {
"type": "array",
"items": {
"type": "string"
}, },
"description": "array of the attribute values to filter" {
}, "attribute_key": "country_code",
"query_operator": { "filter_operator": "equal_to",
"type": "string", "values": [
"description": "query operator name", "us"
"enum": [ ],
"AND", "query_operator": null
"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"
}
]
} }
} }
], ],
@ -2907,63 +2912,68 @@
"type": "integer" "type": "integer"
}, },
{ {
"name": "payload", "name": "body",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"type": "array", "type": "object",
"items": { "properties": {
"type": "object", "payload": {
"properties": { "type": "array",
"attribute_key": { "items": {
"type": "string", "type": "object",
"description": "filter attribute name" "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": { "example": [
"type": "string", {
"description": "filter operator name", "attribute_key": "browser_language",
"enum": [ "filter_operator": "not_eq",
"equal_to", "values": [
"not_equal_to", "en"
"contains", ],
"does_not_contain" "query_operator": "AND"
]
},
"values": {
"type": "array",
"items": {
"type": "string"
}, },
"description": "array of the attribute values to filter" {
}, "attribute_key": "status",
"query_operator": { "filter_operator": "eq",
"type": "string", "values": [
"description": "query operator name", "pending"
"enum": [ ],
"AND", "query_operator": null
"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"
}
]
} }
} }
], ],