Skip to content

[OAS][Detection Engine] Clean up remaining errors#266228

Merged
yctercero merged 15 commits intoelastic:mainfrom
yctercero:spec2
Apr 30, 2026
Merged

[OAS][Detection Engine] Clean up remaining errors#266228
yctercero merged 15 commits intoelastic:mainfrom
yctercero:spec2

Conversation

@yctercero
Copy link
Copy Markdown
Contributor

@yctercero yctercero commented Apr 28, 2026

Summary

This PR updates OpenAPI (OAS) documentation for HTTP APIs (api/detection_engine, api/lists, api/exception_lists): clearer descriptions, summaries, examples (request/response/params), and deprecation notes where routes are legacy or migration-related.

Scope: spec / documentation only. It does not change request or response validation schemas, route handlers, or runtime behavior—only how those routes are described in the OAS layer.

Ran and found no more errors:

node scripts/validate_oas_docs.js \
  --path /api/detection_engine --path /api/detection_engine \
  --path /api/lists --path /api/lists \
  --path /api/exception_lists --path /api/exception_lists \
--path /api/exceptions --path /api/exceptions
 info About to validate spec at ./oas_docs/output/kibana.yaml
   │ warn ./oas_docs/output/kibana.yaml is NOT valid
   │ warn Found the following issues
   │
   │
   │
   │ warn Found 0 errors in ./oas_docs/output/kibana.yaml
 info About to validate spec at ./oas_docs/output/kibana.serverless.yaml
   │ warn ./oas_docs/output/kibana.serverless.yaml is NOT valid
   │ warn Found the following issues
   │
   │
   │
   │ warn Found 0 errors in ./oas_docs/output/kibana.serverless.yaml
 info Validation complete

@yctercero yctercero self-assigned this Apr 28, 2026
@yctercero yctercero added release_note:skip Skip the PR/issue when compiling release notes Team:Detection Engine Security Solution Detection Engine Area Feature:OAS Work or issues related to Core-provided mechanisms for generating OAS backport:version Backport to applied version labels v9.4.0 v9.5.0 labels Apr 28, 2026
@yctercero yctercero marked this pull request as ready for review April 28, 2026 20:50
@yctercero yctercero requested a review from a team as a code owner April 28, 2026 20:50
@yctercero yctercero requested review from a team as code owners April 28, 2026 20:50
@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

Pinging @elastic/security-detection-engine (Team:Detection Engine)

@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod Bot requested a review from a team as a code owner April 28, 2026 22:05
@nikitaindik nikitaindik removed their request for review April 29, 2026 07:49
/**
* Elasticsearch update by query response
*/
export const SetAlertAssigneesResponse = lazySchema(() => z.object({}).catchall(z.unknown()));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PhilippeOberti the scripts keep adding this in. Could you confirm this is ok?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm honestly not sure if it's ok, but looking at a neighbor's file, I see this for alert tags:

export const SetAlertTagsResponse = lazySchema(() => z.object({}).catchall(z.unknown()));

Introduced in this recent PR. So I'm guessing the answer is yes it's ok do to it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is this same example for alert status:

export const SetAlertsStatusResponse = lazySchema(() => z.object({}).catchall(z.unknown()));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI lazySchema() helper was introduced in @kbn/openapi-generator in #264125. This is an action item to mitigate significantly increased Kibana idle memory consumption.

Please let me know if some functionality doesn't work because of lazySchema() helper. The helper should be transparent for functionality. And our tests didn't reveal issues.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PhilippeOberti I'm waiting on green to merge after confirming with Maxim. Let me know if you feel any changes should be made and I'm happy to follow up.

Copy link
Copy Markdown
Contributor

@dhurley14 dhurley14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DE changes lgtm but I have the same question for the SetAlertAssigneesResponse catchall. My initial feelings is it should be a little more specific perhaps? cc: @PhilippeOberti

@yctercero yctercero enabled auto-merge (squash) April 30, 2026 16:13
@kibanamachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] x-pack/platform/test/serverless/functional/configs/observability/config.group1.ts / Serverless Common UI - Home Page Sample data in serverless Sample data loads

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 12.0MB 12.0MB +63.0B

History

cc @yctercero

@yctercero yctercero merged commit 7e40e24 into elastic:main Apr 30, 2026
18 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.4

https://github.com/elastic/kibana/actions/runs/25180470889

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
9.4 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.4:
- Fix OAS validation errors in entity analytics privilege monitoring APIs && Risk Score APIs (#265470)
- [OAS] Improve spec descriptions, summaries, examples (#265153)
- [Cases][Docs] - Add additional examples and cleanup to openApi (#263617)
- [Entity Analytics] Add missing OpenAPI descriptions and examples to p… (#264778)
- [Osquery] Enables OpenAPI documentation for 5 new Osquery 9.4 API endpoints (#262810)

Manual backport

To create the backport manually run:

node scripts/backport --pr 266228

Questions ?

Please refer to the Backport tool documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:OAS Work or issues related to Core-provided mechanisms for generating OAS release_note:skip Skip the PR/issue when compiling release notes Team:Detection Engine Security Solution Detection Engine Area v9.4.0 v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants