Skip to content

Commit cd9d418

Browse files
rmyzcursoragentkibanamachine
authored
[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

oas_docs/output/kibana.serverless.yaml

Lines changed: 187 additions & 0 deletions
Large diffs are not rendered by default.

oas_docs/output/kibana.yaml

Lines changed: 232 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"./oas_docs/output/kibana.yaml": 112,
3-
"./oas_docs/output/kibana.serverless.yaml": 94
2+
"./oas_docs/output/kibana.yaml": 56,
3+
"./oas_docs/output/kibana.serverless.yaml": 53
44
}

0 commit comments

Comments
 (0)