-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security Assistant] Aligning API Schemas #188704
Conversation
...kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.schema.yaml
Outdated
Show resolved
Hide resolved
…both bundles in a local docs folder
...ckages/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.schema.yaml
Outdated
Show resolved
Hide resolved
...packages/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.schema.yaml
Outdated
Show resolved
Hide resolved
...ck/packages/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.schema.yaml
Outdated
Show resolved
Hide resolved
...nt-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.schema.yaml
Outdated
Show resolved
Hide resolved
...sistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.schema.yaml
Outdated
Show resolved
Hide resolved
...ssistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml
Outdated
Show resolved
Hide resolved
...astic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml
Outdated
Show resolved
Hide resolved
...packages/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.schema.yaml
Outdated
Show resolved
Hide resolved
...ckages/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.schema.yaml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spong thank you for addressing OpenAPI tasks 👍
I looked through the diff and don't have any concerns regarding OpenAPI specs from general point of view. Though I didn't check that the specs match the implementation. But since generated artefacts are used in the implementation chances the implementation and specs don't match are quite low.
After this PR is merged the PR to enable bundling at pipeline will boil down to .buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh
changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Public APIs missing comments
History
To update your PR or re-run it, just comment with: cc @spong |
## Summary This PR aims to address elastic#183825 to ensure all our public API's have a corresponding OpenAPI spec and to ensure that they are documented as intended. I've updated the kbn-elastic-assistant-common `yarn openapi:bundle` script to generate both `ess` and `serverless` artifacts (as per [this issue](elastic/security-team#9516), which are now created within the package (instead of `target`), and so are checked in to `x-pack/packages/kbn-elastic-assistant-common/docs/openapi/`. This also includes: - [X] Create OpenAPI specs for the endpoints listed above (see [issue](elastic#183825)). - They had already existed - [X] Check if there are any other public endpoints that you own that don't have OpenAPI specs and add them to the list above. - All endpoints (public/internal) had specs, but did need to update the `path`'s to make sure they were consistent with what was registered. - [X] Make sure the specs you add are valid OpenAPI documents. - [X] Make sure the specs you add match the actual API contract defined in the code. - [X] Mark the endpoints as available in ESS, or Serverless, or in both offerings. --- Initial evaluation of routes listed as missing specs in elastic#183825: - [X] `POST /api/elastic_assistant/current_user/conversations/{id}/messages` Latest/Actual Route: `/internal/elastic_assistant/current_user/conversations/{id}/messages` Route Handler: https://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/plugins/elastic_assistant/server/routes/user_conversations/append_conversation_messages_route.ts#L22 Schema: https://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L151-L191 - [X] `POST /api/elastic_assistant/current_user/conversations` Updated Route: `/api/security_ai_assistant/current_user/conversations` Route Handler: https://github.com/elastic/kibana/blob/1d4e9b9b53b5b6dcdc88c08ae5d9858daa483fe0/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.ts#L21 Schema: https://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L6-L39 - [X] GET /api/elastic_assistant/current_user/conversations/_find Updated Route: `/api/security_ai_assistant/current_user/conversations/_find` Route Handler: https://github.com/elastic/kibana/blob/1d4e9b9b53b5b6dcdc88c08ae5d9858daa483fe0/x-pack/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts#L26 Schema: https://github.com/elastic/kibana/blob/1b872fbf9dc90d3c82a569a9faef9e360fc41171/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.schema.yaml#L94-L180 - [X] DELETE /api/elastic_assistant/current_user/conversations/{id} Updated Route: `/api/security_ai_assistant/current_user/conversations/{id}` Route Handler: https://github.com/elastic/kibana/blob/1d5cf48a9700ee769f64256c23278fcfd8cecc5d/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.ts#L19 Schema: https://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L116-L149 - [X] GET /api/elastic_assistant/current_user/conversations/{id} Updated Route: `/api/security_ai_assistant/current_user/conversations/{id}` Route Handler: https://github.com/elastic/kibana/blob/1d5cf48a9700ee769f64256c23278fcfd8cecc5d/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts#L21 Schema: https://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L42-L75 - [X] PUT /api/elastic_assistant/current_user/conversations/{id} Updated Route: `/api/security_ai_assistant/current_user/conversations/{id}` Route Handler: https://github.com/elastic/kibana/blob/1d5cf48a9700ee769f64256c23278fcfd8cecc5d/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts#L24 Schema: https://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L76-L115 To continue with remaining public routes.... --------- Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit a51b775)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.15`: - [[Security Assistant] Aligning API Schemas (#188704)](#188704) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Garrett Spong","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-07-24T14:03:46Z","message":"[Security Assistant] Aligning API Schemas (#188704)\n\n## Summary\r\n\r\nThis PR aims to address https://github.com/elastic/kibana/issues/183825\r\nto ensure all our public API's have a corresponding OpenAPI spec and to\r\nensure that they are documented as intended.\r\n\r\nI've updated the kbn-elastic-assistant-common `yarn openapi:bundle`\r\nscript to generate both `ess` and `serverless` artifacts (as per [this\r\nissue](elastic/security-team#9516), which are\r\nnow created within the package (instead of `target`), and so are checked\r\nin to `x-pack/packages/kbn-elastic-assistant-common/docs/openapi/`.\r\n\r\n\r\nThis also includes:\r\n\r\n- [X] Create OpenAPI specs for the endpoints listed above (see\r\n[issue](https://github.com/elastic/kibana/issues/183825)).\r\n - They had already existed \r\n- [X] Check if there are any other public endpoints that you own that\r\ndon't have OpenAPI specs and add them to the list above.\r\n- All endpoints (public/internal) had specs, but did need to update the\r\n`path`'s to make sure they were consistent with what was registered.\r\n- [X] Make sure the specs you add are valid OpenAPI documents.\r\n- [X] Make sure the specs you add match the actual API contract defined\r\nin the code.\r\n- [X] Mark the endpoints as available in ESS, or Serverless, or in both\r\nofferings.\r\n\r\n---\r\nInitial evaluation of routes listed as missing specs in\r\nhttps://github.com//issues/183825:\r\n\r\n- [X] `POST\r\n/api/elastic_assistant/current_user/conversations/{id}/messages`\r\nLatest/Actual Route:\r\n`/internal/elastic_assistant/current_user/conversations/{id}/messages`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/plugins/elastic_assistant/server/routes/user_conversations/append_conversation_messages_route.ts#L22\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L151-L191\r\n\r\n\r\n- [X] `POST /api/elastic_assistant/current_user/conversations`\r\nUpdated Route: `/api/security_ai_assistant/current_user/conversations`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/1d4e9b9b53b5b6dcdc88c08ae5d9858daa483fe0/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.ts#L21\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L6-L39\r\n\r\n- [X] GET /api/elastic_assistant/current_user/conversations/_find\r\nUpdated Route:\r\n`/api/security_ai_assistant/current_user/conversations/_find`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/1d4e9b9b53b5b6dcdc88c08ae5d9858daa483fe0/x-pack/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts#L26\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/1b872fbf9dc90d3c82a569a9faef9e360fc41171/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.schema.yaml#L94-L180\r\n\r\n- [X] DELETE /api/elastic_assistant/current_user/conversations/{id}\r\nUpdated Route:\r\n`/api/security_ai_assistant/current_user/conversations/{id}`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/1d5cf48a9700ee769f64256c23278fcfd8cecc5d/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.ts#L19\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L116-L149\r\n\r\n- [X] GET /api/elastic_assistant/current_user/conversations/{id}\r\nUpdated Route:\r\n`/api/security_ai_assistant/current_user/conversations/{id}`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/1d5cf48a9700ee769f64256c23278fcfd8cecc5d/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts#L21\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L42-L75\r\n\r\n- [X] PUT /api/elastic_assistant/current_user/conversations/{id}\r\nUpdated Route:\r\n`/api/security_ai_assistant/current_user/conversations/{id}`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/1d5cf48a9700ee769f64256c23278fcfd8cecc5d/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts#L24\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L76-L115\r\n\r\n\r\nTo continue with remaining public routes....\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"a51b775391af09b6ba2ee9456489ef3351f8875a","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:Security Assistant","Team:Security Generative AI","v8.15.0","v8.16.0"],"title":"[Security Assistant] Aligning API Schemas","number":188704,"url":"https://github.com/elastic/kibana/pull/188704","mergeCommit":{"message":"[Security Assistant] Aligning API Schemas (#188704)\n\n## Summary\r\n\r\nThis PR aims to address https://github.com/elastic/kibana/issues/183825\r\nto ensure all our public API's have a corresponding OpenAPI spec and to\r\nensure that they are documented as intended.\r\n\r\nI've updated the kbn-elastic-assistant-common `yarn openapi:bundle`\r\nscript to generate both `ess` and `serverless` artifacts (as per [this\r\nissue](elastic/security-team#9516), which are\r\nnow created within the package (instead of `target`), and so are checked\r\nin to `x-pack/packages/kbn-elastic-assistant-common/docs/openapi/`.\r\n\r\n\r\nThis also includes:\r\n\r\n- [X] Create OpenAPI specs for the endpoints listed above (see\r\n[issue](https://github.com/elastic/kibana/issues/183825)).\r\n - They had already existed \r\n- [X] Check if there are any other public endpoints that you own that\r\ndon't have OpenAPI specs and add them to the list above.\r\n- All endpoints (public/internal) had specs, but did need to update the\r\n`path`'s to make sure they were consistent with what was registered.\r\n- [X] Make sure the specs you add are valid OpenAPI documents.\r\n- [X] Make sure the specs you add match the actual API contract defined\r\nin the code.\r\n- [X] Mark the endpoints as available in ESS, or Serverless, or in both\r\nofferings.\r\n\r\n---\r\nInitial evaluation of routes listed as missing specs in\r\nhttps://github.com//issues/183825:\r\n\r\n- [X] `POST\r\n/api/elastic_assistant/current_user/conversations/{id}/messages`\r\nLatest/Actual Route:\r\n`/internal/elastic_assistant/current_user/conversations/{id}/messages`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/plugins/elastic_assistant/server/routes/user_conversations/append_conversation_messages_route.ts#L22\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L151-L191\r\n\r\n\r\n- [X] `POST /api/elastic_assistant/current_user/conversations`\r\nUpdated Route: `/api/security_ai_assistant/current_user/conversations`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/1d4e9b9b53b5b6dcdc88c08ae5d9858daa483fe0/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.ts#L21\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L6-L39\r\n\r\n- [X] GET /api/elastic_assistant/current_user/conversations/_find\r\nUpdated Route:\r\n`/api/security_ai_assistant/current_user/conversations/_find`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/1d4e9b9b53b5b6dcdc88c08ae5d9858daa483fe0/x-pack/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts#L26\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/1b872fbf9dc90d3c82a569a9faef9e360fc41171/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.schema.yaml#L94-L180\r\n\r\n- [X] DELETE /api/elastic_assistant/current_user/conversations/{id}\r\nUpdated Route:\r\n`/api/security_ai_assistant/current_user/conversations/{id}`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/1d5cf48a9700ee769f64256c23278fcfd8cecc5d/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.ts#L19\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L116-L149\r\n\r\n- [X] GET /api/elastic_assistant/current_user/conversations/{id}\r\nUpdated Route:\r\n`/api/security_ai_assistant/current_user/conversations/{id}`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/1d5cf48a9700ee769f64256c23278fcfd8cecc5d/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts#L21\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L42-L75\r\n\r\n- [X] PUT /api/elastic_assistant/current_user/conversations/{id}\r\nUpdated Route:\r\n`/api/security_ai_assistant/current_user/conversations/{id}`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/1d5cf48a9700ee769f64256c23278fcfd8cecc5d/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts#L24\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L76-L115\r\n\r\n\r\nTo continue with remaining public routes....\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"a51b775391af09b6ba2ee9456489ef3351f8875a"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/188704","number":188704,"mergeCommit":{"message":"[Security Assistant] Aligning API Schemas (#188704)\n\n## Summary\r\n\r\nThis PR aims to address https://github.com/elastic/kibana/issues/183825\r\nto ensure all our public API's have a corresponding OpenAPI spec and to\r\nensure that they are documented as intended.\r\n\r\nI've updated the kbn-elastic-assistant-common `yarn openapi:bundle`\r\nscript to generate both `ess` and `serverless` artifacts (as per [this\r\nissue](elastic/security-team#9516), which are\r\nnow created within the package (instead of `target`), and so are checked\r\nin to `x-pack/packages/kbn-elastic-assistant-common/docs/openapi/`.\r\n\r\n\r\nThis also includes:\r\n\r\n- [X] Create OpenAPI specs for the endpoints listed above (see\r\n[issue](https://github.com/elastic/kibana/issues/183825)).\r\n - They had already existed \r\n- [X] Check if there are any other public endpoints that you own that\r\ndon't have OpenAPI specs and add them to the list above.\r\n- All endpoints (public/internal) had specs, but did need to update the\r\n`path`'s to make sure they were consistent with what was registered.\r\n- [X] Make sure the specs you add are valid OpenAPI documents.\r\n- [X] Make sure the specs you add match the actual API contract defined\r\nin the code.\r\n- [X] Mark the endpoints as available in ESS, or Serverless, or in both\r\nofferings.\r\n\r\n---\r\nInitial evaluation of routes listed as missing specs in\r\nhttps://github.com//issues/183825:\r\n\r\n- [X] `POST\r\n/api/elastic_assistant/current_user/conversations/{id}/messages`\r\nLatest/Actual Route:\r\n`/internal/elastic_assistant/current_user/conversations/{id}/messages`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/plugins/elastic_assistant/server/routes/user_conversations/append_conversation_messages_route.ts#L22\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L151-L191\r\n\r\n\r\n- [X] `POST /api/elastic_assistant/current_user/conversations`\r\nUpdated Route: `/api/security_ai_assistant/current_user/conversations`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/1d4e9b9b53b5b6dcdc88c08ae5d9858daa483fe0/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.ts#L21\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L6-L39\r\n\r\n- [X] GET /api/elastic_assistant/current_user/conversations/_find\r\nUpdated Route:\r\n`/api/security_ai_assistant/current_user/conversations/_find`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/1d4e9b9b53b5b6dcdc88c08ae5d9858daa483fe0/x-pack/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts#L26\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/1b872fbf9dc90d3c82a569a9faef9e360fc41171/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.schema.yaml#L94-L180\r\n\r\n- [X] DELETE /api/elastic_assistant/current_user/conversations/{id}\r\nUpdated Route:\r\n`/api/security_ai_assistant/current_user/conversations/{id}`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/1d5cf48a9700ee769f64256c23278fcfd8cecc5d/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.ts#L19\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L116-L149\r\n\r\n- [X] GET /api/elastic_assistant/current_user/conversations/{id}\r\nUpdated Route:\r\n`/api/security_ai_assistant/current_user/conversations/{id}`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/1d5cf48a9700ee769f64256c23278fcfd8cecc5d/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts#L21\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L42-L75\r\n\r\n- [X] PUT /api/elastic_assistant/current_user/conversations/{id}\r\nUpdated Route:\r\n`/api/security_ai_assistant/current_user/conversations/{id}`\r\nRoute Handler:\r\nhttps://github.com/elastic/kibana/blob/1d5cf48a9700ee769f64256c23278fcfd8cecc5d/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts#L24\r\nSchema:\r\nhttps://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L76-L115\r\n\r\n\r\nTo continue with remaining public routes....\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"a51b775391af09b6ba2ee9456489ef3351f8875a"}}]}] BACKPORT--> Co-authored-by: Garrett Spong <[email protected]>
Summary
This PR aims to address #183825 to ensure all our public API's have a corresponding OpenAPI spec and to ensure that they are documented as intended.
I've updated the kbn-elastic-assistant-common
yarn openapi:bundle
script to generate bothess
andserverless
artifacts (as per this issue, which are now created within the package (instead oftarget
), and so are checked in tox-pack/packages/kbn-elastic-assistant-common/docs/openapi/
.This also includes:
path
's to make sure they were consistent with what was registered.Initial evaluation of routes listed as missing specs in #183825:
POST /api/elastic_assistant/current_user/conversations/{id}/messages
Latest/Actual Route:
/internal/elastic_assistant/current_user/conversations/{id}/messages
Route Handler:
kibana/x-pack/plugins/elastic_assistant/server/routes/user_conversations/append_conversation_messages_route.ts
Line 22 in bae84d4
Schema:
kibana/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml
Lines 151 to 191 in bae84d4
POST /api/elastic_assistant/current_user/conversations
Updated Route:
/api/security_ai_assistant/current_user/conversations
Route Handler:
kibana/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.ts
Line 21 in 1d4e9b9
Schema:
kibana/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml
Lines 6 to 39 in bae84d4
GET /api/elastic_assistant/current_user/conversations/_find
Updated Route:
/api/security_ai_assistant/current_user/conversations/_find
Route Handler:
kibana/x-pack/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts
Line 26 in 1d4e9b9
Schema:
kibana/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.schema.yaml
Lines 94 to 180 in 1b872fb
DELETE /api/elastic_assistant/current_user/conversations/{id}
Updated Route:
/api/security_ai_assistant/current_user/conversations/{id}
Route Handler:
kibana/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.ts
Line 19 in 1d5cf48
Schema:
kibana/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml
Lines 116 to 149 in bae84d4
GET /api/elastic_assistant/current_user/conversations/{id}
Updated Route:
/api/security_ai_assistant/current_user/conversations/{id}
Route Handler:
kibana/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts
Line 21 in 1d5cf48
Schema:
kibana/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml
Lines 42 to 75 in bae84d4
PUT /api/elastic_assistant/current_user/conversations/{id}
Updated Route:
/api/security_ai_assistant/current_user/conversations/{id}
Route Handler:
kibana/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts
Line 24 in 1d5cf48
Schema:
kibana/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml
Lines 76 to 115 in bae84d4
To continue with remaining public routes....