Skip to content

Commit

Permalink
[Cases] Custom Fields API documentation (#166353)
Browse files Browse the repository at this point in the history
## Summary

This was missing in my previous PR #165671
  • Loading branch information
adcoelho authored Sep 14, 2023
1 parent a5eaad9 commit f204d72
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 7 deletions.
54 changes: 54 additions & 0 deletions x-pack/plugins/cases/docs/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -4579,6 +4579,54 @@
],
"default": "low"
},
"custom_fields_property": {
"type": "array",
"description": "Values for custom fields of a case",
"minItems": 0,
"maxItems": 5,
"items": {
"type": "object",
"required": [
"key",
"type",
"field"
],
"properties": {
"key": {
"description": "The key identifying the custom field.",
"type": "string"
},
"type": {
"description": "The type of the custom field. Should match the key and how the custom field was configured",
"type": "string"
},
"field": {
"description": "An object containing the value of the field.",
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"description": "The value of the field.",
"nullable": true,
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "boolean"
}
]
}
}
}
}
}
}
},
"create_case_request": {
"title": "Create case request",
"description": "The create case API request body varies depending on the type of connector.",
Expand Down Expand Up @@ -4652,6 +4700,9 @@
"description": "A title for the case.",
"type": "string",
"maxLength": 160
},
"customFields": {
"$ref": "#/components/schemas/custom_fields_property"
}
}
},
Expand Down Expand Up @@ -5296,6 +5347,9 @@
"version": {
"description": "The current version of the case. To determine this value, use the get case or find cases APIs.",
"type": "string"
},
"customFields": {
"$ref": "#/components/schemas/custom_fields_property"
}
}
}
Expand Down
36 changes: 36 additions & 0 deletions x-pack/plugins/cases/docs/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2890,6 +2890,38 @@ components:
- low
- medium
default: low
custom_fields_property:
type: array
description: Values for custom fields of a case
minItems: 0
maxItems: 5
items:
type: object
required:
- key
- type
- field
properties:
key:
description: The key identifying the custom field.
type: string
type:
description: The type of the custom field. Should match the key and how the custom field was configured
type: string
field:
description: An object containing the value of the field.
type: object
required:
- value
properties:
value:
description: The value of the field.
nullable: true
type: array
items:
anyOf:
- type: string
- type: boolean
create_case_request:
title: Create case request
description: The create case API request body varies depending on the type of connector.
Expand Down Expand Up @@ -2938,6 +2970,8 @@ components:
description: A title for the case.
type: string
maxLength: 160
customFields:
$ref: '#/components/schemas/custom_fields_property'
case_response_closed_by_properties:
title: Case response properties for closed_by
type: object
Expand Down Expand Up @@ -3403,6 +3437,8 @@ components:
version:
description: The current version of the case. To determine this value, use the get case or find cases APIs.
type: string
customFields:
$ref: '#/components/schemas/custom_fields_property'
searchFieldsType:
type: string
description: The fields to perform the `simple_query_string` parsed query against.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ description: >-
The create case API request body varies depending on the type of connector.
type: object
required:
- connector
- description
- owner
- settings
- tags
- title
- connector
- description
- owner
- settings
- tags
- title
properties:
assignees:
$ref: 'assignees.yaml'
Expand Down Expand Up @@ -45,4 +45,6 @@ properties:
title:
description: A title for the case.
type: string
maxLength: 160
maxLength: 160
customFields:
$ref: 'custom_fields_property.yaml'
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
type: array
description: Values for custom fields of a case
minItems: 0
maxItems: 5
items:
type: object
required:
- key
- type
- field
properties:
key:
description: The key identifying the custom field.
type: string
type:
description: The type of the custom field. Should match the key and how the custom field was configured
type: string
field:
description: An object containing the value of the field.
type: object
required:
- value
properties:
value:
description: The value of the field.
nullable: true
type: array
items:
anyOf:
- type: string
- type: boolean
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ properties:
version:
description: The current version of the case. To determine this value, use the get case or find cases APIs.
type: string
customFields:
$ref: 'custom_fields_property.yaml'

0 comments on commit f204d72

Please sign in to comment.