Commit cd9d418
[APM] Add missing OpenAPI examples to public APIs (elastic#268628)
## Summary
Closes elastic#266312.
Adds the missing `examples` blocks on request/response bodies across the
APM public OpenAPI surface so that `node scripts/validate_oas_docs.js
--path /api/apm` reports zero schema errors on both traditional and
serverless (was 56 / 41).
All remaining failures shared the same defect: `must have required
property 'examples'` on `requestBody.content.application/json` or
`responses[*].content.application/json`. Where the same example pattern
fits multiple endpoints (error responses), the examples are reused via
`$ref` to a shared component, as suggested in the issue.
### What changed
- 6 reusable error-response example files (`error_400_response.yaml` ...
`error_501_response.yaml`).
- 2 missing 200-response examples: `agent_name` GET, `annotation/search`
GET.
- 1 multipart request-body example for `POST /api/apm/sourcemaps`.
- `examples` `$ref` blocks wired into every error response across the 11
path files, plus the new 200 / request body slots. Inline `examples`
added to the `apm_server_schema` POST body.
- Regenerated `bundled.yaml` / `bundled.json`.
`oas_docs/output/kibana.yaml`, `kibana.serverless.yaml`, and
`oas_error_baseline.json` will be regenerated and auto-committed by the
CI `capture_oas_snapshot` step.
### Verification
Locally, after running `make merge-api-docs`:
```
node scripts/validate_oas_docs.js --only traditional --path /api/apm
-> Found 0 errors in ./oas_docs/output/kibana.yaml
node scripts/validate_oas_docs.js --only serverless --path /api/apm
-> Found 0 errors in ./oas_docs/output/kibana.serverless.yaml
```
### Checklist
- [x] Local validation passes for `/api/apm` (traditional + serverless).
- [ ] CI `capture_oas_snapshot` step regenerates `kibana.yaml` /
`kibana.serverless.yaml` and the validator baseline.
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>1 parent 7995f4c commit cd9d418
25 files changed
Lines changed: 1243 additions & 2 deletions
File tree
- oas_docs/output
- src/platform/packages/private/kbn-validate-oas/src
- x-pack/solutions/observability/plugins/apm/docs/openapi/apm
- components/examples
- paths
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
0 commit comments