Skip to content

Add missing OpenAPI examples for SLO endpoints#259859

Open
jasonrhodes wants to merge 7 commits intoelastic:mainfrom
jasonrhodes:slo-oas-examples
Open

Add missing OpenAPI examples for SLO endpoints#259859
jasonrhodes wants to merge 7 commits intoelastic:mainfrom
jasonrhodes:slo-oas-examples

Conversation

@jasonrhodes
Copy link
Member

Closes #259854

Summary

Adds missing examples to all 12 public SLO API operations in the hand-written OpenAPI spec, covering all 57 previously missing example entries.

What was missing:

  • 5 request body examples (create, update, bulk delete, bulk purge rollup, delete instances)
  • 8 success (200) response examples
  • 44 error response examples (400/401/403/404/409)

What was added:

  • Realistic request body examples using KQL custom indicator type with production-like data
  • Full SLO response examples including summary, error budget, and status fields
  • Multiple examples where helpful (e.g. partial update, purge by age vs timestamp, bulk delete with partial failure)
  • Consistent error response examples across all endpoints

Files changed:

  • 9 path YAML files in x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/
  • Regenerated bundled.json and bundled.yaml

Validation:

  • swagger-cli validate entrypoint.yaml passes
  • @redocly/cli bundle succeeds
  • Audit script confirms 0 missing examples remaining

Checklist

  • Documentation was added for features that require explanation or tutorials
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

Risk Matrix

Risk Probability Severity Mitigation
Examples don't match actual API behavior Low Low Examples derived from existing schema field-level examples
YAML formatting issues Low Low Validated with swagger-cli and redocly bundle

Made with Cursor

Adds request body and response examples to all 12 public SLO API
operations, covering all 57 previously missing example entries in the
OpenAPI spec. Includes realistic examples for success responses,
error responses (400/401/403/404/409), and request bodies for create,
update, bulk delete, bulk purge, and delete instances.

Made-with: Cursor
@jasonrhodes jasonrhodes requested a review from a team as a code owner March 26, 2026 18:49
@jasonrhodes jasonrhodes added the Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. label Mar 26, 2026
@elasticmachine
Copy link
Contributor

Pinging @elastic/actionable-obs-team (Team:actionable-obs)

@github-actions github-actions bot added the author:actionable-obs PRs authored by the actionable obs team label Mar 26, 2026
@macroscopeapp
Copy link

macroscopeapp bot commented Mar 26, 2026

Approvability

Verdict: Would Approve

This PR adds OpenAPI documentation examples for SLO endpoints with no runtime code changes. All modifications are to API specification files adding example requests/responses and fixing error response descriptions. The open review comments are minor nitpicks about example data consistency.

Macroscope would have approved this PR. A repo admin can enable approvability here.

@jasonrhodes jasonrhodes added backport:version Backport to applied version labels v9.4.0 v9.3.3 v9.2.8 backport:skip This PR does not require backporting release_note:feature Makes this part of the condensed release notes and removed backport:version Backport to applied version labels v9.3.3 v9.2.8 labels Mar 26, 2026
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner March 26, 2026 19:23
summary: Forbidden
value:
statusCode: 403
error: Unauthorized
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should be Forbidden

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, not a nit!

value:
page: 1
perPage: 25
total: 2
Copy link
Contributor

Choose a reason for hiding this comment

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

ocd: total 2 but only 1 result 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

Would total here be the total SLOs or the total number of pages available? I'm not sure

@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner March 26, 2026 19:51
Copy link
Contributor

@mdbirnstiehl mdbirnstiehl left a comment

Choose a reason for hiding this comment

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

LGTM

The 403_response.yaml component schema had title and error example
set to 'Unauthorized' instead of 'Forbidden'. Also fixes the
description on all 403 response entries in path files from
'Unauthorized response' to 'Forbidden response'. This was a
pre-existing bug in the SLO OAS spec, not introduced by this PR.

Made-with: Cursor
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

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

Labels

author:actionable-obs PRs authored by the actionable obs team backport:skip This PR does not require backporting release_note:feature Makes this part of the condensed release notes Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OAS] api/observability: add missing examples for SLO endpoints

5 participants