Skip to content

[DOCS] Add missing "required" property in Security APIs#240921

Merged
lcawl merged 40 commits intoelastic:mainfrom
lcawl:oas-security
Nov 17, 2025
Merged

[DOCS] Add missing "required" property in Security APIs#240921
lcawl merged 40 commits intoelastic:mainfrom
lcawl:oas-security

Conversation

@lcawl
Copy link
Copy Markdown
Contributor

@lcawl lcawl commented Oct 28, 2025

Summary

Relates to #233419, #228077

This PR addresses the following errors that are returned by node scripts/validate_oas_docs.js:

  /paths/~1api~1security_ai_assistant~1knowledge_base~1{resource}/post/parameters/0
   │      must have required property 'required'
  
 /paths/~1api~1security_ai_assistant~1knowledge_base~1{resource}/get/parameters/0
   │      must have required property 'required'

 /paths/~1api~1security_ai_assistant~1knowledge_base~1entries~1{id}/put/responses/200/content/application~1json
   │      must have required property 'examples'
   │      Failed check @ schema path: #/required

Per discussion with @spong the API is valid both with and without the resource parameter. This PR therefore adds the second variation of the path and updates the code to use the new path where appropriate. No functional changes were necessary as the Kibana server supports optional path params, so all that was needed was to override the generated types to make resource optional again for all the existing usages.

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

N/A

@lcawl lcawl added Team:Docs release_note:skip Skip the PR/issue when compiling release notes docs backport:version + v9.2.0 labels Oct 28, 2025
@lcawl lcawl marked this pull request as ready for review October 28, 2025 02:29
@lcawl lcawl requested a review from a team as a code owner October 28, 2025 02:29
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/experience-docs (Team:Docs)

@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner October 28, 2025 02:58
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner October 28, 2025 03:12
lcawl and others added 5 commits October 28, 2025 08:22
…atus --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/streams --include-path /api/fleet --include-path /api/saved_objects/_import --include-path /api/saved_objects/_export --include-path /api/maintenance_window --include-path /api/agent_builder --update
Copy link
Copy Markdown
Contributor

@TinaHeiligers TinaHeiligers left a comment

Choose a reason for hiding this comment

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

LGTM

@lcawl lcawl enabled auto-merge (squash) October 30, 2025 14:52
…atus --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/streams --include-path /api/fleet --include-path /api/saved_objects/_import --include-path /api/saved_objects/_export --include-path /api/maintenance_window --include-path /api/agent_builder --update
@lcawl lcawl added backport:version Backport to applied version labels v9.3.0 v9.2.1 and removed backport:version + v9.2.0 labels Oct 30, 2025
lcawl and others added 5 commits November 3, 2025 07:47
…atus --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/streams --include-path /api/fleet --include-path /api/saved_objects/_import --include-path /api/saved_objects/_export --include-path /api/maintenance_window --include-path /api/agent_builder --update
lcawl and others added 6 commits November 12, 2025 07:29
…atus --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/streams --include-path /api/fleet --include-path /api/saved_objects/_import --include-path /api/saved_objects/_export --include-path /api/maintenance_window --include-path /api/agent_builder --update
@spong spong added ci:project-deploy-security Create a Security Serverless Project ci:cloud-deploy-elser If set, the ML node in the ES cluster will be deployed with considerations towards the ELSER model labels Nov 15, 2025
@spong
Copy link
Copy Markdown
Member

spong commented Nov 15, 2025

I've added the cloud/serverless deployment labels so we can do a quick smoke test to confirm, but this should be good to go as there ended up being no functional changes. Once tested I'll approve and we can get this merged. Thanks for raising this @lcawl!

@spong spong added ci:cloud-redeploy Always create a new Cloud deployment and removed ci:cloud-deploy-elser If set, the ML node in the ES cluster will be deployed with considerations towards the ELSER model labels Nov 17, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Nov 17, 2025

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/elastic-assistant-common 763 774 +11

Async chunks

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

id before after diff
securitySolution 11.1MB 11.1MB +723.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
elasticAssistant 305.9KB 306.8KB +917.0B
Unknown metric groups

API count

id before after diff
@kbn/elastic-assistant-common 893 904 +11

History

Copy link
Copy Markdown
Member

@spong spong left a comment

Choose a reason for hiding this comment

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

Confirmed existing route functionality is working as expected on CI cloud deployment:

GET /api/security_ai_assistant/knowledge_base/

POST /api/security_ai_assistant/knowledge_base/

So long as the doc outputs are as you expect @lcawl, this LGTM from my end! 🙂

@lcawl lcawl merged commit 4f056d6 into elastic:main Nov 17, 2025
12 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.2

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

@lcawl lcawl deleted the oas-security branch November 17, 2025 23:22
@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
9.2 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.2:
- [links] fix Can not save Dashboard after switching a Dashboard Link to an External Link (#243134)
- [Search] Disable custom suggestion on embedded console (#241516)
- [GenAi] Clean up default LLM setting feature flag. (#242543)
- [Lens][Suggestion API] Improve suggestion API to listen to preferred chart sub types (#242902)
- Revert "[SLO] Fix issue where filters do not apply to overview stats" (#242978)

Manual backport

To create the backport manually run:

node scripts/backport --pr 240921

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Nov 19, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 240921 locally
cc: @lcawl

@lcawl
Copy link
Copy Markdown
Contributor Author

lcawl commented Nov 19, 2025

💚 All backports created successfully

Status Branch Result
9.2

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 Nov 19, 2025
Co-authored-by: Garrett Spong <garrett.spong@elastic.co>
(cherry picked from commit 4f056d6)
lcawl added a commit that referenced this pull request Nov 20, 2025
… (#243581)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[DOCS] Add missing "required" property in Security APIs
(#240921)](#240921)

<!--- 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":"2025-11-17T23:20:18Z","message":"[DOCS]
Add missing \"required\" property in Security APIs
(#240921)\n\nCo-authored-by: Garrett Spong
<garrett.spong@elastic.co>","sha":"4f056d632363f21d6cc4a2090aae4bd5e1bbcb4c","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","release_note:skip","backport
missing","docs","ci:cloud-redeploy","ci:project-deploy-security","backport:version","v9.3.0","v9.2.1"],"title":"[DOCS]
Add missing \"required\" property in Security
APIs","number":240921,"url":"https://github.com/elastic/kibana/pull/240921","mergeCommit":{"message":"[DOCS]
Add missing \"required\" property in Security APIs
(#240921)\n\nCo-authored-by: Garrett Spong
<garrett.spong@elastic.co>","sha":"4f056d632363f21d6cc4a2090aae4bd5e1bbcb4c"}},"sourceBranch":"main","suggestedTargetBranches":["9.2"],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/240921","number":240921,"mergeCommit":{"message":"[DOCS]
Add missing \"required\" property in Security APIs
(#240921)\n\nCo-authored-by: Garrett Spong
<garrett.spong@elastic.co>","sha":"4f056d632363f21d6cc4a2090aae4bd5e1bbcb4c"}},{"branch":"9.2","label":"v9.2.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Garrett Spong <garrett.spong@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine kibanamachine added v9.2.2 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Nov 20, 2025
eokoneyo pushed a commit to eokoneyo/kibana that referenced this pull request Dec 2, 2025
Co-authored-by: Garrett Spong <garrett.spong@elastic.co>
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 ci:cloud-redeploy Always create a new Cloud deployment ci:project-deploy-security Create a Security Serverless Project docs release_note:skip Skip the PR/issue when compiling release notes Team:Docs v9.2.1 v9.2.2 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants