Skip to content

Commit

Permalink
Remove anonymous combinatorial types from cases api spec (#194782)
Browse files Browse the repository at this point in the history
## Summary

These type definitions cause code generation to fail with one of the
more popular Go generators due to
oapi-codegen/oapi-codegen#1496.


### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
tobio and kibanamachine authored Oct 8, 2024
1 parent 43bc586 commit 05f19d0
Show file tree
Hide file tree
Showing 37 changed files with 314 additions and 301 deletions.
109 changes: 56 additions & 53 deletions oas_docs/output/kibana.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6952,7 +6952,7 @@ paths:
- $ref: '#/components/parameters/Cases_category'
- $ref: '#/components/parameters/Cases_defaultSearchOperator'
- $ref: '#/components/parameters/Cases_from'
- $ref: '#/components/parameters/Cases_owner'
- $ref: '#/components/parameters/Cases_owner_filter'
- $ref: '#/components/parameters/Cases_page_index'
- $ref: '#/components/parameters/Cases_page_size'
- $ref: '#/components/parameters/Cases_reporters'
Expand Down Expand Up @@ -7400,7 +7400,7 @@ paths:
operationId: getCasesByAlertDefaultSpace
parameters:
- $ref: '#/components/parameters/Cases_alert_id'
- $ref: '#/components/parameters/Cases_owner'
- $ref: '#/components/parameters/Cases_owner_filter'
responses:
'200':
content:
Expand Down Expand Up @@ -7441,7 +7441,7 @@ paths:
where the cases were created.
operationId: getCaseConfigurationDefaultSpace
parameters:
- $ref: '#/components/parameters/Cases_owner'
- $ref: '#/components/parameters/Cases_owner_filter'
responses:
'200':
content:
Expand Down Expand Up @@ -7572,7 +7572,7 @@ paths:
type: string
type: array
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
templates:
$ref: '#/components/schemas/Cases_templates'
updated_at:
Expand Down Expand Up @@ -7620,7 +7620,7 @@ paths:
post:
description: >
Case settings include external connection details, custom fields, and
templates. Connectors are used to interface with external systems. You
templates. Connectors are used to interface with external systems. You
must create a connector before you can use it in your cases. If you set
a default connector, it is automatically selected when you create cases
in Kibana. If you use the create case API, however, you must still
Expand Down Expand Up @@ -7768,7 +7768,7 @@ paths:
type: string
type: array
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
templates:
$ref: '#/components/schemas/Cases_templates'
updated_at:
Expand Down Expand Up @@ -7964,7 +7964,7 @@ paths:
type: string
type: array
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
templates:
$ref: '#/components/schemas/Cases_templates'
updated_at:
Expand Down Expand Up @@ -8073,7 +8073,7 @@ paths:
returned by this API is unchanged.
operationId: getCaseReportersDefaultSpace
parameters:
- $ref: '#/components/parameters/Cases_owner'
- $ref: '#/components/parameters/Cases_owner_filter'
responses:
'200':
content:
Expand Down Expand Up @@ -8128,7 +8128,7 @@ paths:
privileges, depending on the owner of the cases you're seeking.
operationId: getCaseStatusDefaultSpace
parameters:
- $ref: '#/components/parameters/Cases_owner'
- $ref: '#/components/parameters/Cases_owner_filter'
responses:
'200':
content:
Expand Down Expand Up @@ -8161,7 +8161,7 @@ paths:
privileges, depending on the owner of the cases you're seeking.
operationId: getCaseTagsDefaultSpace
parameters:
- $ref: '#/components/parameters/Cases_owner'
- $ref: '#/components/parameters/Cases_owner_filter'
responses:
'200':
content:
Expand Down Expand Up @@ -45306,11 +45306,8 @@ components:
name: assignees
schema:
oneOf:
- type: string
- items:
type: string
maxItems: 100
type: array
- $ref: '#/components/schemas/Cases_string'
- $ref: '#/components/schemas/Cases_string_array'
Cases_case_id:
description: >-
The identifier for the case. To retrieve case IDs, use the find cases
Expand All @@ -45327,12 +45324,8 @@ components:
name: category
schema:
oneOf:
- example: my-category
type: string
- items:
type: string
maxItems: 100
type: array
- $ref: '#/components/schemas/Cases_case_category'
- $ref: '#/components/schemas/Cases_case_categories'
Cases_comment_id:
description: >
The identifier for the comment. To retrieve comment IDs, use the get
Expand Down Expand Up @@ -45409,7 +45402,7 @@ components:
required: true
schema:
type: string
Cases_owner:
Cases_owner_filter:
description: >
A filter to limit the response to a specific set of applications. If
this parameter is omitted, the response contains information about all
Expand All @@ -45419,10 +45412,8 @@ components:
name: owner
schema:
oneOf:
- $ref: '#/components/schemas/Cases_owner'
- $ref: '#/components/schemas/Cases_owners'
- items:
$ref: '#/components/schemas/Cases_owners'
type: array
Cases_page_index:
description: The page number to return.
in: query
Expand All @@ -45447,11 +45438,8 @@ components:
name: reporters
schema:
oneOf:
- type: string
- items:
type: string
maxItems: 100
type: array
- $ref: '#/components/schemas/Cases_string'
- $ref: '#/components/schemas/Cases_string_array'
Cases_search:
description: >-
An Elasticsearch simple_query_string query that filters the objects in
Expand All @@ -45467,9 +45455,7 @@ components:
schema:
oneOf:
- $ref: '#/components/schemas/Cases_searchFieldsType'
- items:
$ref: '#/components/schemas/Cases_searchFieldsType'
type: array
- $ref: '#/components/schemas/Cases_searchFieldsTypeArray'
Cases_severity:
description: The severity of the case.
in: query
Expand Down Expand Up @@ -45526,11 +45512,8 @@ components:
name: tags
schema:
oneOf:
- type: string
- items:
type: string
maxItems: 100
type: array
- $ref: '#/components/schemas/Cases_string'
- $ref: '#/components/schemas/Cases_string_array'
Cases_to:
description: >
Returns only cases that were created before a specific date. The date
Expand Down Expand Up @@ -45844,7 +45827,7 @@ components:
index:
$ref: '#/components/schemas/Cases_alert_indices'
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
rule:
$ref: '#/components/schemas/Cases_rule'
type:
Expand Down Expand Up @@ -45882,7 +45865,7 @@ components:
maxLength: 30000
type: string
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
type:
description: The type of comment.
enum:
Expand Down Expand Up @@ -45939,7 +45922,7 @@ components:
type: string
type: array
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
pushed_at:
example: null
format: date-time
Expand Down Expand Up @@ -46082,6 +46065,11 @@ components:
maxItems: 10
nullable: true
type: array
Cases_case_categories:
items:
$ref: '#/components/schemas/Cases_case_category'
maxItems: 100
type: array
Cases_case_category:
description: A word or phrase that categorizes the case.
maxLength: 50
Expand Down Expand Up @@ -46243,7 +46231,7 @@ components:
example: 66b9aa00-94fa-11ea-9f74-e7e108796192
type: string
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
settings:
$ref: '#/components/schemas/Cases_settings'
severity:
Expand Down Expand Up @@ -46775,7 +46763,7 @@ components:
description:
$ref: '#/components/schemas/Cases_case_description'
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
settings:
$ref: '#/components/schemas/Cases_settings'
severity:
Expand Down Expand Up @@ -46829,7 +46817,7 @@ components:
example: elastic
nullable: true
type: string
Cases_owners:
Cases_owner:
description: >
The application that owns the cases: Stack Management, Observability, or
Elastic Security.
Expand All @@ -46839,6 +46827,10 @@ components:
- securitySolution
example: cases
type: string
Cases_owners:
items:
$ref: '#/components/schemas/Cases_owner'
type: array
Cases_payload_alert_comment:
type: object
properties:
Expand All @@ -46860,7 +46852,7 @@ components:
type: string
type: array
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
rule:
type: object
properties:
Expand Down Expand Up @@ -47090,7 +47082,7 @@ components:
description:
type: string
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
settings:
$ref: '#/components/schemas/Cases_settings'
severity:
Expand Down Expand Up @@ -47159,7 +47151,7 @@ components:
comment:
type: string
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
type:
enum:
- user
Expand Down Expand Up @@ -47189,6 +47181,10 @@ components:
- description
- title
type: string
Cases_searchFieldsTypeArray:
items:
$ref: '#/components/schemas/Cases_searchFieldsType'
type: array
Cases_set_case_configuration_request:
description: >-
External connection details, such as the closure type and default
Expand Down Expand Up @@ -47275,7 +47271,7 @@ components:
minItems: 0
type: array
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
templates:
$ref: '#/components/schemas/Cases_templates'
required:
Expand All @@ -47294,6 +47290,13 @@ components:
type: boolean
required:
- syncAlerts
Cases_string:
type: string
Cases_string_array:
items:
$ref: '#/components/schemas/Cases_string'
maxItems: 100
type: array
Cases_template_tags:
description: >
The words and phrases that help categorize templates. It can be an empty
Expand Down Expand Up @@ -47406,7 +47409,7 @@ components:
index:
$ref: '#/components/schemas/Cases_alert_indices'
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
rule:
$ref: '#/components/schemas/Cases_rule'
type:
Expand Down Expand Up @@ -47650,7 +47653,7 @@ components:
example: 8af6ac20-74f6-11ea-b83a-553aecdb28b6
type: string
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
type:
description: The type of comment.
enum:
Expand Down Expand Up @@ -47710,7 +47713,7 @@ components:
example: 22fd3e30-03b1-11ed-920c-974bfa104448
type: string
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
payload:
oneOf:
- $ref: '#/components/schemas/Cases_payload_alert_comment'
Expand Down Expand Up @@ -47797,7 +47800,7 @@ components:
- full_name
- username
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
payload:
oneOf:
- $ref: '#/components/schemas/Cases_payload_alert_comment'
Expand Down Expand Up @@ -47842,7 +47845,7 @@ components:
example: 8af6ac20-74f6-11ea-b83a-553aecdb28b6
type: string
owner:
$ref: '#/components/schemas/Cases_owners'
$ref: '#/components/schemas/Cases_owner'
pushed_at:
example: null
format: date-time
Expand Down
Loading

0 comments on commit 05f19d0

Please sign in to comment.