Skip to content

[DOCS] Fix OpenAPI linting error in detection_engine#248570

Merged
lcawl merged 17 commits intoelastic:mainfrom
lcawl:iterable
Jan 23, 2026
Merged

[DOCS] Fix OpenAPI linting error in detection_engine#248570
lcawl merged 17 commits intoelastic:mainfrom
lcawl:iterable

Conversation

@lcawl
Copy link
Copy Markdown
Contributor

@lcawl lcawl commented Jan 10, 2026

Summary

This PR is an attempt to fix the following linting error that is returned when you run make api-docs-lint or npx @redocly/cli lint output/kibana.yaml --config ./linters/redocly.yaml from the oas_docs directory:

validating output/kibana.yaml...
Something went wrong when processing output/kibana.yaml:

  - examples is not iterable

Swagger editor also identified Security_Detections_API_SetAlertAssigneesBody as an object that includes not allowed fields. Per https://swagger.io/docs/specification/v3_0/adding-examples/#object-and-property-examples "Note that schemas and properties support single example but not multiple examples". Therefore, I've defined the examples separately and called them at a higher level. The same changes were also required in SetAlertTagsBody.

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@lcawl lcawl added release_note:skip Skip the PR/issue when compiling release notes docs Team:Detection Engine Security Solution Detection Engine Area backport:all-open Backport to all branches that could still receive a release backport:version Backport to applied version labels v9.3.0 v9.4.0 v8.19.10 and removed backport:all-open Backport to all branches that could still receive a release labels Jan 10, 2026
@lcawl lcawl marked this pull request as ready for review January 12, 2026 16:16
@lcawl lcawl requested a review from a team as a code owner January 12, 2026 16:16
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@lcawl lcawl requested a review from a team as a code owner January 12, 2026 16:39
@lcawl lcawl marked this pull request as draft January 12, 2026 16:42
@lcawl lcawl marked this pull request as ready for review January 12, 2026 20:02
@lcawl lcawl requested review from a team as code owners January 12, 2026 20:03
@lcawl lcawl requested a review from nkhristinin January 12, 2026 20:03
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod Bot requested a review from a team as a code owner January 12, 2026 20:18
@lcawl
Copy link
Copy Markdown
Contributor Author

lcawl commented Jan 14, 2026

I did pick up an incorrectly migrated example under SetAlertAssigneesBodyRemove, which appears to be the same as SetAlertAssigneesBodyAdd in the changes you proposed. Looks like a minor thing that got overlooked but would be great if you can look into that while I try and figure out the other problem with the generator throwing those weird errors.

Good catch! I've fixed that cut and paste error. Thanks for tackling the pipeline issue!

@maximpn
Copy link
Copy Markdown
Contributor

maximpn commented Jan 21, 2026

@lcawl @sdesalas

I've pushed a could of commits fixing OAS code generation in kbn-openapi-generator and related OAS linting rules. The build should pass now.

FYI, kbn-openapi-bundler used for OAS -> API documentation supports different examples paths.

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Jan 21, 2026

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Serverless Investigations - Security Solution Cypress Tests #4 / Dashboard Migrations - Translated Dashboards Page should be able to reprocess a failed Dashboard should be able to reprocess a failed Dashboard

Metrics [docs]

✅ unchanged

History

@lcawl lcawl enabled auto-merge (squash) January 22, 2026 00:39
if (options.skipKeys?.includes(key)) {
return;
}

Copy link
Copy Markdown
Member

@sdesalas sdesalas Jan 22, 2026

Choose a reason for hiding this comment

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

Nice work @maximpn 👌 . Even made this extensible in case there are other future schema paths we need to ignore.

Copy link
Copy Markdown
Member

@sdesalas sdesalas left a comment

Choose a reason for hiding this comment

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

Hi @lcawl. All looking good on my part, happy to approve.

  • CI pipeline is passing (thanks @maximpn)
  • Visual inspection of openapi YAML structure does not flag anything strange
  • Testing YAML before and after in the swagger editor generate same output

I think we're good to merge. 🚀

Thank you again 🙏 for reviewing these linting issues.

@lcawl lcawl merged commit da6bf3e into elastic:main Jan 23, 2026
16 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19, 9.3

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

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts
9.3 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 248570

Questions ?

Please refer to the Backport tool documentation

lcawl added a commit to lcawl/kibana that referenced this pull request Jan 23, 2026
Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
(cherry picked from commit da6bf3e)
@lcawl
Copy link
Copy Markdown
Contributor Author

lcawl commented Jan 23, 2026

💚 All backports created successfully

Status Branch Result
9.3
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

lcawl added a commit to lcawl/kibana that referenced this pull request Jan 23, 2026
Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
(cherry picked from commit da6bf3e)
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jan 27, 2026
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @lcawl

1 similar comment
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @lcawl

lcawl added a commit that referenced this pull request Jan 28, 2026
…250276)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[DOCS] Fix OpenAPI linting error in detection_engine
(#248570)](#248570)

<!--- Backport version: 10.2.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Lisa
Cawley","email":"lcawley@elastic.co"},"sourceCommit":{"committedDate":"2026-01-23T10:04:15Z","message":"[DOCS]
Fix OpenAPI linting error in detection_engine
(#248570)\n\nCo-authored-by: Maxim Palenov
<maxim.palenov@elastic.co>","sha":"da6bf3ecab9d48b569d444f81c2e037cd4404cec","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","docs","Team:Detection
Engine","backport:version","v9.3.0","v9.4.0","v8.19.10"],"title":"[DOCS]
Fix OpenAPI linting error in
detection_engine","number":248570,"url":"https://github.com/elastic/kibana/pull/248570","mergeCommit":{"message":"[DOCS]
Fix OpenAPI linting error in detection_engine
(#248570)\n\nCo-authored-by: Maxim Palenov
<maxim.palenov@elastic.co>","sha":"da6bf3ecab9d48b569d444f81c2e037cd4404cec"}},"sourceBranch":"main","suggestedTargetBranches":["9.3","8.19"],"targetPullRequestStates":[{"branch":"9.3","label":"v9.3.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/248570","number":248570,"mergeCommit":{"message":"[DOCS]
Fix OpenAPI linting error in detection_engine
(#248570)\n\nCo-authored-by: Maxim Palenov
<maxim.palenov@elastic.co>","sha":"da6bf3ecab9d48b569d444f81c2e037cd4404cec"}},{"branch":"8.19","label":"v8.19.10","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
lcawl added a commit that referenced this pull request Jan 28, 2026
…#250278)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[DOCS] Fix OpenAPI linting error in detection_engine
(#248570)](#248570)

<!--- Backport version: 10.2.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Lisa
Cawley","email":"lcawley@elastic.co"},"sourceCommit":{"committedDate":"2026-01-23T10:04:15Z","message":"[DOCS]
Fix OpenAPI linting error in detection_engine
(#248570)\n\nCo-authored-by: Maxim Palenov
<maxim.palenov@elastic.co>","sha":"da6bf3ecab9d48b569d444f81c2e037cd4404cec","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","docs","Team:Detection
Engine","backport:version","v9.3.0","v9.4.0","v8.19.10"],"title":"[DOCS]
Fix OpenAPI linting error in
detection_engine","number":248570,"url":"https://github.com/elastic/kibana/pull/248570","mergeCommit":{"message":"[DOCS]
Fix OpenAPI linting error in detection_engine
(#248570)\n\nCo-authored-by: Maxim Palenov
<maxim.palenov@elastic.co>","sha":"da6bf3ecab9d48b569d444f81c2e037cd4404cec"}},"sourceBranch":"main","suggestedTargetBranches":["9.3","8.19"],"targetPullRequestStates":[{"branch":"9.3","label":"v9.3.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/248570","number":248570,"mergeCommit":{"message":"[DOCS]
Fix OpenAPI linting error in detection_engine
(#248570)\n\nCo-authored-by: Maxim Palenov
<maxim.palenov@elastic.co>","sha":"da6bf3ecab9d48b569d444f81c2e037cd4404cec"}},{"branch":"8.19","label":"v8.19.10","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
@kibanamachine kibanamachine added v8.19.11 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Jan 28, 2026
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 docs release_note:skip Skip the PR/issue when compiling release notes Team:Detection Engine Security Solution Detection Engine Area v8.19.10 v8.19.11 v9.3.0 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants