[Docs][Visualizations API] Add request and response examples for all 5 endpoints#262874
Merged
Conversation
teresaalvarezsoler
approved these changes
Apr 14, 2026
Contributor
teresaalvarezsoler
left a comment
There was a problem hiding this comment.
This looks good to me, thanks @florent-leborgne
Contributor
|
Pinging @elastic/experience-docs (Team:Docs) |
…r all 5 endpoints
Adds request code samples (cURL + Console) and response examples to every
Visualizations API endpoint, following the same pattern as the Dashboards API:
- POST: metric + XY line chart code samples, trimmed 201 response example
- GET (search): code sample, paginated response example with 2 items
- GET /{id}: code sample, single visualization response example
- PUT /{id}: code sample, updated visualization response example
- DELETE /{id}: code sample only (204 no body)
Response examples are based on live API responses with server-added defaults
(sampling, ignore_global_filters, empty_as_null, axis defaults) trimmed for clarity.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Reorder metric data fields to match actual API response: title → data_source → type (was incorrectly title → type → data_source in all 4 metric response examples) - PUT response: set created_at equal to updated_at to match actual API behavior, with a note that created_at reflects update time in PUT responses Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Response examples now match the complete live API output including sampling, ignore_global_filters, empty_as_null, styling (metric), and axis/styling/legend (XY). These are part of the public contract and users need to see them to understand what the API returns. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Code samples (x-codeSamples): - metric (data_view_spec) — cURL + Console - XY line chart (data_view_spec) — cURL + Console - pie/donut chart (data_view_spec) — cURL + Console - data table (data_view_spec) — cURL + Console - metric (data_view_reference) — cURL + Console Response examples (201): - createMetricVisualizationResponse - createXYVisualizationResponse - createPieVisualizationResponse - createDataTableVisualizationResponse - createDataViewReferenceResponse All payloads tested against a live Kibana 9.4.0 instance. Response examples include full server-populated defaults. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
e5b84c5 to
e2cceb3
Compare
This was referenced Apr 14, 2026
markov00
approved these changes
Apr 20, 2026
Contributor
💚 Build Succeeded
Metrics [docs]
History
|
Contributor
|
Starting backport for target branches: 9.4 https://github.com/elastic/kibana/actions/runs/24669312988 |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Apr 20, 2026
…5 endpoints (elastic#262874) ## Summary Adds cURL and Console code samples and inlined response examples to all 5 Visualizations API endpoints. ### Code samples (`x-codeSamples`) | Endpoint | Examples | |---|---| | `POST /api/visualizations` | Metric chart (`data_view_spec`); XY line chart; Pie/donut chart; Data table; Metric chart (`data_view_reference`) | | `GET /api/visualizations` | Search visualizations | | `GET /api/visualizations/{id}` | Get a visualization | | `PUT /api/visualizations/{id}` | Update a visualization | | `DELETE /api/visualizations/{id}` | Delete a visualization | Each example has a cURL and Console variant. The `esql` data source is not covered — it is not yet supported by the Visualizations API (returns 400); use the Dashboards API for ES|QL visualizations. ### Response examples | Endpoint | Response code | Named examples | |---|---|---| | `POST /api/visualizations` | 201 | createMetricVisualizationResponse, createXYVisualizationResponse, createPieVisualizationResponse, createDataTableVisualizationResponse, createDataViewReferenceResponse | | `GET /api/visualizations` | 200 | searchVisualizationsResponse (two items: metric + XY) | | `GET /api/visualizations/{id}` | 200 | getVisualizationResponse (metric) | | `PUT /api/visualizations/{id}` | 200 | updateVisualizationResponse (metric) | All payloads tested against a live Kibana 9.4.0 instance using the Kibana sample logs dataset. ## Preview https://bump.sh/elastic/hub/elastic-apis/doc/visualizations-api-cleanup-intro-get-started/group/endpoint-visualizations ## Test plan - [ ] Verify code samples appear in the upper-right dropdown for each endpoint - [ ] Verify response examples appear in the Responses section with correct named tabs - [ ] Confirm all JSON in code samples is fully expanded (no inline objects) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> (cherry picked from commit 286db8c)
Contributor
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
florent-leborgne
added a commit
that referenced
this pull request
Apr 20, 2026
## Summary Part of the Lens Visualizations API documentation series. **Series:** - PR 1/4: Introduction and get-started overlay — merged (#262595) - **PR 2/4 (this PR):** Endpoint descriptions and field descriptions - PR 3/4: Request code samples and response examples (#262874) - Viz PR B: Chart type schema descriptions (#263571) ## What changed ### Route files — all 5 endpoints Added `description` strings and `since: '9.4.0'` to all five routes. ### `schema/search.ts`, `schema/create.ts`, `schema/common.ts` - `query` search param: description added inline - `id` path param on delete/get/update: improved description - `total` response field: description added inline ### `schema/delete.ts`, `schema/get.ts`, `schema/update.ts` Updated `id` description to reference where the ID comes from. ### Shared package: `@kbn/as-code-shared-schemas` Added `meta.description` to all 7 fields of `asCodeMetaSchema` (`created_at`, `created_by`, `managed`, `owner`, `updated_at`, `updated_by`, `version`). > **Note:** descriptions added to `@kbn/content-management-utils` (`savedObjectSchema.id`, `searchOptionsSchemas.*`, `createOptionsSchemas.overwrite`) were **reverted** per feedback from ThomThomson — content management schemas are not part of the public as-code API surface. Descriptions for `fields`, `search_fields`, `overwrite`, and `id` will be handled via overlay fallback. ## Open items - Two CodeQL findings on `kbn-content-management-utils/src/schema.ts` (unbounded arrays) — pre-existing, not introduced by this PR - davismcphee's architectural question answered: content-management-utils changes reverted 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine
added a commit
to kibanamachine/kibana
that referenced
this pull request
Apr 20, 2026
…ic#263151) ## Summary Part of the Lens Visualizations API documentation series. **Series:** - PR 1/4: Introduction and get-started overlay — merged (elastic#262595) - **PR 2/4 (this PR):** Endpoint descriptions and field descriptions - PR 3/4: Request code samples and response examples (elastic#262874) - Viz PR B: Chart type schema descriptions (elastic#263571) ## What changed ### Route files — all 5 endpoints Added `description` strings and `since: '9.4.0'` to all five routes. ### `schema/search.ts`, `schema/create.ts`, `schema/common.ts` - `query` search param: description added inline - `id` path param on delete/get/update: improved description - `total` response field: description added inline ### `schema/delete.ts`, `schema/get.ts`, `schema/update.ts` Updated `id` description to reference where the ID comes from. ### Shared package: `@kbn/as-code-shared-schemas` Added `meta.description` to all 7 fields of `asCodeMetaSchema` (`created_at`, `created_by`, `managed`, `owner`, `updated_at`, `updated_by`, `version`). > **Note:** descriptions added to `@kbn/content-management-utils` (`savedObjectSchema.id`, `searchOptionsSchemas.*`, `createOptionsSchemas.overwrite`) were **reverted** per feedback from ThomThomson — content management schemas are not part of the public as-code API surface. Descriptions for `fields`, `search_fields`, `overwrite`, and `id` will be handled via overlay fallback. ## Open items - Two CodeQL findings on `kbn-content-management-utils/src/schema.ts` (unbounded arrays) — pre-existing, not introduced by this PR - davismcphee's architectural question answered: content-management-utils changes reverted 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit c2bbbc4)
kibanamachine
added a commit
that referenced
this pull request
Apr 20, 2026
…r all 5 endpoints (#262874) (#264416) # Backport This will backport the following commits from `main` to `9.4`: - [[Docs][Visualizations API] Add request and response examples for all 5 endpoints (#262874)](#262874) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Florent LB","email":"florent.leborgne@elastic.co"},"sourceCommit":{"committedDate":"2026-04-20T13:30:10Z","message":"[Docs][Visualizations API] Add request and response examples for all 5 endpoints (#262874)\n\n## Summary\n\nAdds cURL and Console code samples and inlined response examples to all\n5 Visualizations API endpoints.\n\n### Code samples (`x-codeSamples`)\n\n| Endpoint | Examples |\n|---|---|\n| `POST /api/visualizations` | Metric chart (`data_view_spec`); XY line\nchart; Pie/donut chart; Data table; Metric chart (`data_view_reference`)\n|\n| `GET /api/visualizations` | Search visualizations |\n| `GET /api/visualizations/{id}` | Get a visualization |\n| `PUT /api/visualizations/{id}` | Update a visualization |\n| `DELETE /api/visualizations/{id}` | Delete a visualization |\n\nEach example has a cURL and Console variant. The `esql` data source is\nnot covered — it is not yet supported by the Visualizations API (returns\n400); use the Dashboards API for ES|QL visualizations.\n\n### Response examples\n\n| Endpoint | Response code | Named examples |\n|---|---|---|\n| `POST /api/visualizations` | 201 | createMetricVisualizationResponse,\ncreateXYVisualizationResponse, createPieVisualizationResponse,\ncreateDataTableVisualizationResponse, createDataViewReferenceResponse |\n| `GET /api/visualizations` | 200 | searchVisualizationsResponse (two\nitems: metric + XY) |\n| `GET /api/visualizations/{id}` | 200 | getVisualizationResponse\n(metric) |\n| `PUT /api/visualizations/{id}` | 200 | updateVisualizationResponse\n(metric) |\n\nAll payloads tested against a live Kibana 9.4.0 instance using the\nKibana sample logs dataset.\n\n## Preview\n\n\nhttps://bump.sh/elastic/hub/elastic-apis/doc/visualizations-api-cleanup-intro-get-started/group/endpoint-visualizations\n\n## Test plan\n\n- [ ] Verify code samples appear in the upper-right dropdown for each\nendpoint\n- [ ] Verify response examples appear in the Responses section with\ncorrect named tabs\n- [ ] Confirm all JSON in code samples is fully expanded (no inline\nobjects)\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>","sha":"286db8cc5002de3c0d9620d3bd2e0436e7ca8344","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","release_note:skip","docs","APIDocs","backport:version","v9.4.0","v9.5.0"],"title":"[Docs][Visualizations API] Add request and response examples for all 5 endpoints","number":262874,"url":"https://github.com/elastic/kibana/pull/262874","mergeCommit":{"message":"[Docs][Visualizations API] Add request and response examples for all 5 endpoints (#262874)\n\n## Summary\n\nAdds cURL and Console code samples and inlined response examples to all\n5 Visualizations API endpoints.\n\n### Code samples (`x-codeSamples`)\n\n| Endpoint | Examples |\n|---|---|\n| `POST /api/visualizations` | Metric chart (`data_view_spec`); XY line\nchart; Pie/donut chart; Data table; Metric chart (`data_view_reference`)\n|\n| `GET /api/visualizations` | Search visualizations |\n| `GET /api/visualizations/{id}` | Get a visualization |\n| `PUT /api/visualizations/{id}` | Update a visualization |\n| `DELETE /api/visualizations/{id}` | Delete a visualization |\n\nEach example has a cURL and Console variant. The `esql` data source is\nnot covered — it is not yet supported by the Visualizations API (returns\n400); use the Dashboards API for ES|QL visualizations.\n\n### Response examples\n\n| Endpoint | Response code | Named examples |\n|---|---|---|\n| `POST /api/visualizations` | 201 | createMetricVisualizationResponse,\ncreateXYVisualizationResponse, createPieVisualizationResponse,\ncreateDataTableVisualizationResponse, createDataViewReferenceResponse |\n| `GET /api/visualizations` | 200 | searchVisualizationsResponse (two\nitems: metric + XY) |\n| `GET /api/visualizations/{id}` | 200 | getVisualizationResponse\n(metric) |\n| `PUT /api/visualizations/{id}` | 200 | updateVisualizationResponse\n(metric) |\n\nAll payloads tested against a live Kibana 9.4.0 instance using the\nKibana sample logs dataset.\n\n## Preview\n\n\nhttps://bump.sh/elastic/hub/elastic-apis/doc/visualizations-api-cleanup-intro-get-started/group/endpoint-visualizations\n\n## Test plan\n\n- [ ] Verify code samples appear in the upper-right dropdown for each\nendpoint\n- [ ] Verify response examples appear in the Responses section with\ncorrect named tabs\n- [ ] Confirm all JSON in code samples is fully expanded (no inline\nobjects)\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>","sha":"286db8cc5002de3c0d9620d3bd2e0436e7ca8344"}},"sourceBranch":"main","suggestedTargetBranches":["9.4"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/262874","number":262874,"mergeCommit":{"message":"[Docs][Visualizations API] Add request and response examples for all 5 endpoints (#262874)\n\n## Summary\n\nAdds cURL and Console code samples and inlined response examples to all\n5 Visualizations API endpoints.\n\n### Code samples (`x-codeSamples`)\n\n| Endpoint | Examples |\n|---|---|\n| `POST /api/visualizations` | Metric chart (`data_view_spec`); XY line\nchart; Pie/donut chart; Data table; Metric chart (`data_view_reference`)\n|\n| `GET /api/visualizations` | Search visualizations |\n| `GET /api/visualizations/{id}` | Get a visualization |\n| `PUT /api/visualizations/{id}` | Update a visualization |\n| `DELETE /api/visualizations/{id}` | Delete a visualization |\n\nEach example has a cURL and Console variant. The `esql` data source is\nnot covered — it is not yet supported by the Visualizations API (returns\n400); use the Dashboards API for ES|QL visualizations.\n\n### Response examples\n\n| Endpoint | Response code | Named examples |\n|---|---|---|\n| `POST /api/visualizations` | 201 | createMetricVisualizationResponse,\ncreateXYVisualizationResponse, createPieVisualizationResponse,\ncreateDataTableVisualizationResponse, createDataViewReferenceResponse |\n| `GET /api/visualizations` | 200 | searchVisualizationsResponse (two\nitems: metric + XY) |\n| `GET /api/visualizations/{id}` | 200 | getVisualizationResponse\n(metric) |\n| `PUT /api/visualizations/{id}` | 200 | updateVisualizationResponse\n(metric) |\n\nAll payloads tested against a live Kibana 9.4.0 instance using the\nKibana sample logs dataset.\n\n## Preview\n\n\nhttps://bump.sh/elastic/hub/elastic-apis/doc/visualizations-api-cleanup-intro-get-started/group/endpoint-visualizations\n\n## Test plan\n\n- [ ] Verify code samples appear in the upper-right dropdown for each\nendpoint\n- [ ] Verify response examples appear in the Responses section with\ncorrect named tabs\n- [ ] Confirm all JSON in code samples is fully expanded (no inline\nobjects)\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>","sha":"286db8cc5002de3c0d9620d3bd2e0436e7ca8344"}}]}] BACKPORT--> Co-authored-by: Florent LB <florent.leborgne@elastic.co> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
kibanamachine
added a commit
that referenced
this pull request
Apr 20, 2026
…263151) (#264423) # Backport This will backport the following commits from `main` to `9.4`: - [[Docs][Visualizations API] Add endpoint and field descriptions (#263151)](#263151) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Florent LB","email":"florent.leborgne@elastic.co"},"sourceCommit":{"committedDate":"2026-04-20T13:39:35Z","message":"[Docs][Visualizations API] Add endpoint and field descriptions (#263151)\n\n## Summary\n\nPart of the Lens Visualizations API documentation series.\n\n**Series:**\n- PR 1/4: Introduction and get-started overlay — merged (#262595)\n- **PR 2/4 (this PR):** Endpoint descriptions and field descriptions\n- PR 3/4: Request code samples and response examples (#262874)\n- Viz PR B: Chart type schema descriptions (#263571)\n\n## What changed\n\n### Route files — all 5 endpoints\nAdded `description` strings and `since: '9.4.0'` to all five routes.\n\n### `schema/search.ts`, `schema/create.ts`, `schema/common.ts`\n- `query` search param: description added inline\n- `id` path param on delete/get/update: improved description\n- `total` response field: description added inline\n\n### `schema/delete.ts`, `schema/get.ts`, `schema/update.ts`\nUpdated `id` description to reference where the ID comes from.\n\n### Shared package: `@kbn/as-code-shared-schemas`\nAdded `meta.description` to all 7 fields of `asCodeMetaSchema`\n(`created_at`, `created_by`, `managed`, `owner`, `updated_at`,\n`updated_by`, `version`).\n\n> **Note:** descriptions added to `@kbn/content-management-utils`\n(`savedObjectSchema.id`, `searchOptionsSchemas.*`,\n`createOptionsSchemas.overwrite`) were **reverted** per feedback from\nThomThomson — content management schemas are not part of the public\nas-code API surface. Descriptions for `fields`, `search_fields`,\n`overwrite`, and `id` will be handled via overlay fallback.\n\n## Open items\n- Two CodeQL findings on `kbn-content-management-utils/src/schema.ts`\n(unbounded arrays) — pre-existing, not introduced by this PR\n- davismcphee's architectural question answered:\ncontent-management-utils changes reverted\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"c2bbbc461b994391921301fb2960e7a0b5df929b","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","release_note:skip","docs","APIDocs","backport:version","v9.4.0","v9.5.0"],"title":"[Docs][Visualizations API] Add endpoint and field descriptions","number":263151,"url":"https://github.com/elastic/kibana/pull/263151","mergeCommit":{"message":"[Docs][Visualizations API] Add endpoint and field descriptions (#263151)\n\n## Summary\n\nPart of the Lens Visualizations API documentation series.\n\n**Series:**\n- PR 1/4: Introduction and get-started overlay — merged (#262595)\n- **PR 2/4 (this PR):** Endpoint descriptions and field descriptions\n- PR 3/4: Request code samples and response examples (#262874)\n- Viz PR B: Chart type schema descriptions (#263571)\n\n## What changed\n\n### Route files — all 5 endpoints\nAdded `description` strings and `since: '9.4.0'` to all five routes.\n\n### `schema/search.ts`, `schema/create.ts`, `schema/common.ts`\n- `query` search param: description added inline\n- `id` path param on delete/get/update: improved description\n- `total` response field: description added inline\n\n### `schema/delete.ts`, `schema/get.ts`, `schema/update.ts`\nUpdated `id` description to reference where the ID comes from.\n\n### Shared package: `@kbn/as-code-shared-schemas`\nAdded `meta.description` to all 7 fields of `asCodeMetaSchema`\n(`created_at`, `created_by`, `managed`, `owner`, `updated_at`,\n`updated_by`, `version`).\n\n> **Note:** descriptions added to `@kbn/content-management-utils`\n(`savedObjectSchema.id`, `searchOptionsSchemas.*`,\n`createOptionsSchemas.overwrite`) were **reverted** per feedback from\nThomThomson — content management schemas are not part of the public\nas-code API surface. Descriptions for `fields`, `search_fields`,\n`overwrite`, and `id` will be handled via overlay fallback.\n\n## Open items\n- Two CodeQL findings on `kbn-content-management-utils/src/schema.ts`\n(unbounded arrays) — pre-existing, not introduced by this PR\n- davismcphee's architectural question answered:\ncontent-management-utils changes reverted\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"c2bbbc461b994391921301fb2960e7a0b5df929b"}},"sourceBranch":"main","suggestedTargetBranches":["9.4"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/263151","number":263151,"mergeCommit":{"message":"[Docs][Visualizations API] Add endpoint and field descriptions (#263151)\n\n## Summary\n\nPart of the Lens Visualizations API documentation series.\n\n**Series:**\n- PR 1/4: Introduction and get-started overlay — merged (#262595)\n- **PR 2/4 (this PR):** Endpoint descriptions and field descriptions\n- PR 3/4: Request code samples and response examples (#262874)\n- Viz PR B: Chart type schema descriptions (#263571)\n\n## What changed\n\n### Route files — all 5 endpoints\nAdded `description` strings and `since: '9.4.0'` to all five routes.\n\n### `schema/search.ts`, `schema/create.ts`, `schema/common.ts`\n- `query` search param: description added inline\n- `id` path param on delete/get/update: improved description\n- `total` response field: description added inline\n\n### `schema/delete.ts`, `schema/get.ts`, `schema/update.ts`\nUpdated `id` description to reference where the ID comes from.\n\n### Shared package: `@kbn/as-code-shared-schemas`\nAdded `meta.description` to all 7 fields of `asCodeMetaSchema`\n(`created_at`, `created_by`, `managed`, `owner`, `updated_at`,\n`updated_by`, `version`).\n\n> **Note:** descriptions added to `@kbn/content-management-utils`\n(`savedObjectSchema.id`, `searchOptionsSchemas.*`,\n`createOptionsSchemas.overwrite`) were **reverted** per feedback from\nThomThomson — content management schemas are not part of the public\nas-code API surface. Descriptions for `fields`, `search_fields`,\n`overwrite`, and `id` will be handled via overlay fallback.\n\n## Open items\n- Two CodeQL findings on `kbn-content-management-utils/src/schema.ts`\n(unbounded arrays) — pre-existing, not introduced by this PR\n- davismcphee's architectural question answered:\ncontent-management-utils changes reverted\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"c2bbbc461b994391921301fb2960e7a0b5df929b"}}]}] BACKPORT--> Co-authored-by: Florent LB <florent.leborgne@elastic.co> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
florent-leborgne
added a commit
that referenced
this pull request
Apr 28, 2026
…pes (Viz PR B) (#263571) ## Summary Part of the Lens Visualizations API documentation series (Viz PR B). Adds descriptions to all 12 chart type schemas and all supporting schemas. **Series:** - PR 1/4: Introduction overlay — merged (#262595) - PR 2/4: Endpoint + field descriptions (#263151) - PR 3/4: Code samples + response examples (#262874) - **Viz PR B (this PR):** Schema descriptions for all 12 chart types + supporting schemas ## Approach Descriptions only — no schema types, validation constraints, or field names changed. Rebased onto main to pick up #262927 (styling alignment restructuring). ## What changed ### Operation schemas - `metric_ops.ts`: object-level descriptions on `metricOperationDefinitionSchema`, `fieldMetricOrFormulaOperationDefinitionSchema` - `bucket_ops.ts`: descriptions on `bucketOperationDefinitionSchema` and all bucket operation fields; `When \`true\`,` pattern applied throughout - `shared.ts`: fixed tautological `collapseBySchema` description; fixed `ignore_global_filters` and `sampling` descriptions; fixed `axisTitleSchemaProps` ### Chart schemas — all 12 types Object-level descriptions on DSL variant, ES|QL variant, and union schema for every chart type. "DSL data source" consistently replaced with "data view". Additional field-level descriptions on chart-specific fields (shape, alignment, icon, palette, etc.). ### Supporting schemas - `color.ts`: descriptions on all color variant schemas; full palette name list on all palette fields with correct defaults per context - `format.ts`: descriptions on all format variant schemas - `filter.ts`: descriptions on `filterSchema` and `filterWithLabelSchema` - `index.ts`: description on `lensApiStateSchema` top-level union - `xy.ts`: `aggregate_first` description fixed ### Style quality pass - All descriptions standardised to noun phrases (no verb-first descriptions) - `A/An` added to concrete countable noun descriptions - Dropped valid enum values restored (alignment, slice label position, donut hole size) - Redundant numeric min/max removed from description text (auto-rendered by OAS) - `may` → `can` throughout ### Reverted Object-level descriptions added to `@kbn/as-code-data-views-schema` (`dataViewReferenceSchema`, `dataViewSpecSchema`, `runtimeFieldSchema`, etc.) were **reverted** — object-level `meta.description` on schema objects in shared packages does not surface in the OAS output. Will use overlay fallback. ## Test plan - [x] Rebased onto main; conflicts from #262927 resolved - [x] Descriptions verified in combined OAS preview on Bump 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: florent-leborgne <10208282+florent-leborgne@users.noreply.github.com> Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
kibanamachine
added a commit
that referenced
this pull request
Apr 28, 2026
…art types (Viz PR B) (#263571) (#265997) # Backport This will backport the following commits from `main` to `9.4`: - [[Docs][Visualizations API] Add schema descriptions to all 12 chart types (Viz PR B) (#263571)](#263571) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Florent LB","email":"florent.leborgne@elastic.co"},"sourceCommit":{"committedDate":"2026-04-28T09:59:20Z","message":"[Docs][Visualizations API] Add schema descriptions to all 12 chart types (Viz PR B) (#263571)\n\n## Summary\n\nPart of the Lens Visualizations API documentation series (Viz PR B).\nAdds descriptions to all 12 chart type schemas and all supporting\nschemas.\n\n**Series:**\n- PR 1/4: Introduction overlay — merged (#262595)\n- PR 2/4: Endpoint + field descriptions (#263151)\n- PR 3/4: Code samples + response examples (#262874)\n- **Viz PR B (this PR):** Schema descriptions for all 12 chart types +\nsupporting schemas\n\n## Approach\n\nDescriptions only — no schema types, validation constraints, or field\nnames changed. Rebased onto main to pick up #262927 (styling alignment\nrestructuring).\n\n## What changed\n\n### Operation schemas\n- `metric_ops.ts`: object-level descriptions on\n`metricOperationDefinitionSchema`,\n`fieldMetricOrFormulaOperationDefinitionSchema`\n- `bucket_ops.ts`: descriptions on `bucketOperationDefinitionSchema` and\nall bucket operation fields; `When \\`true\\`,` pattern applied throughout\n- `shared.ts`: fixed tautological `collapseBySchema` description; fixed\n`ignore_global_filters` and `sampling` descriptions; fixed\n`axisTitleSchemaProps`\n\n### Chart schemas — all 12 types\nObject-level descriptions on DSL variant, ES|QL variant, and union\nschema for every chart type. \"DSL data source\" consistently replaced\nwith \"data view\". Additional field-level descriptions on chart-specific\nfields (shape, alignment, icon, palette, etc.).\n\n### Supporting schemas\n- `color.ts`: descriptions on all color variant schemas; full palette\nname list on all palette fields with correct defaults per context\n- `format.ts`: descriptions on all format variant schemas\n- `filter.ts`: descriptions on `filterSchema` and\n`filterWithLabelSchema`\n- `index.ts`: description on `lensApiStateSchema` top-level union\n- `xy.ts`: `aggregate_first` description fixed\n\n### Style quality pass\n- All descriptions standardised to noun phrases (no verb-first\ndescriptions)\n- `A/An` added to concrete countable noun descriptions\n- Dropped valid enum values restored (alignment, slice label position,\ndonut hole size)\n- Redundant numeric min/max removed from description text (auto-rendered\nby OAS)\n- `may` → `can` throughout\n\n### Reverted\nObject-level descriptions added to `@kbn/as-code-data-views-schema`\n(`dataViewReferenceSchema`, `dataViewSpecSchema`, `runtimeFieldSchema`,\netc.) were **reverted** — object-level `meta.description` on schema\nobjects in shared packages does not surface in the OAS output. Will use\noverlay fallback.\n\n## Test plan\n- [x] Rebased onto main; conflicts from #262927 resolved\n- [x] Descriptions verified in combined OAS preview on Bump\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>\nCo-authored-by: florent-leborgne <10208282+florent-leborgne@users.noreply.github.com>\nCo-authored-by: Marco Vettorello <vettorello.marco@gmail.com>","sha":"187a8e0c74b9cd78b0b963e3abf92211bc0a7939","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","release_note:skip","docs","APIDocs","backport:version","v9.4.0","v9.5.0"],"title":"[Docs][Visualizations API] Add schema descriptions to all 12 chart types (Viz PR B)","number":263571,"url":"https://github.com/elastic/kibana/pull/263571","mergeCommit":{"message":"[Docs][Visualizations API] Add schema descriptions to all 12 chart types (Viz PR B) (#263571)\n\n## Summary\n\nPart of the Lens Visualizations API documentation series (Viz PR B).\nAdds descriptions to all 12 chart type schemas and all supporting\nschemas.\n\n**Series:**\n- PR 1/4: Introduction overlay — merged (#262595)\n- PR 2/4: Endpoint + field descriptions (#263151)\n- PR 3/4: Code samples + response examples (#262874)\n- **Viz PR B (this PR):** Schema descriptions for all 12 chart types +\nsupporting schemas\n\n## Approach\n\nDescriptions only — no schema types, validation constraints, or field\nnames changed. Rebased onto main to pick up #262927 (styling alignment\nrestructuring).\n\n## What changed\n\n### Operation schemas\n- `metric_ops.ts`: object-level descriptions on\n`metricOperationDefinitionSchema`,\n`fieldMetricOrFormulaOperationDefinitionSchema`\n- `bucket_ops.ts`: descriptions on `bucketOperationDefinitionSchema` and\nall bucket operation fields; `When \\`true\\`,` pattern applied throughout\n- `shared.ts`: fixed tautological `collapseBySchema` description; fixed\n`ignore_global_filters` and `sampling` descriptions; fixed\n`axisTitleSchemaProps`\n\n### Chart schemas — all 12 types\nObject-level descriptions on DSL variant, ES|QL variant, and union\nschema for every chart type. \"DSL data source\" consistently replaced\nwith \"data view\". Additional field-level descriptions on chart-specific\nfields (shape, alignment, icon, palette, etc.).\n\n### Supporting schemas\n- `color.ts`: descriptions on all color variant schemas; full palette\nname list on all palette fields with correct defaults per context\n- `format.ts`: descriptions on all format variant schemas\n- `filter.ts`: descriptions on `filterSchema` and\n`filterWithLabelSchema`\n- `index.ts`: description on `lensApiStateSchema` top-level union\n- `xy.ts`: `aggregate_first` description fixed\n\n### Style quality pass\n- All descriptions standardised to noun phrases (no verb-first\ndescriptions)\n- `A/An` added to concrete countable noun descriptions\n- Dropped valid enum values restored (alignment, slice label position,\ndonut hole size)\n- Redundant numeric min/max removed from description text (auto-rendered\nby OAS)\n- `may` → `can` throughout\n\n### Reverted\nObject-level descriptions added to `@kbn/as-code-data-views-schema`\n(`dataViewReferenceSchema`, `dataViewSpecSchema`, `runtimeFieldSchema`,\netc.) were **reverted** — object-level `meta.description` on schema\nobjects in shared packages does not surface in the OAS output. Will use\noverlay fallback.\n\n## Test plan\n- [x] Rebased onto main; conflicts from #262927 resolved\n- [x] Descriptions verified in combined OAS preview on Bump\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>\nCo-authored-by: florent-leborgne <10208282+florent-leborgne@users.noreply.github.com>\nCo-authored-by: Marco Vettorello <vettorello.marco@gmail.com>","sha":"187a8e0c74b9cd78b0b963e3abf92211bc0a7939"}},"sourceBranch":"main","suggestedTargetBranches":["9.4"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/263571","number":263571,"mergeCommit":{"message":"[Docs][Visualizations API] Add schema descriptions to all 12 chart types (Viz PR B) (#263571)\n\n## Summary\n\nPart of the Lens Visualizations API documentation series (Viz PR B).\nAdds descriptions to all 12 chart type schemas and all supporting\nschemas.\n\n**Series:**\n- PR 1/4: Introduction overlay — merged (#262595)\n- PR 2/4: Endpoint + field descriptions (#263151)\n- PR 3/4: Code samples + response examples (#262874)\n- **Viz PR B (this PR):** Schema descriptions for all 12 chart types +\nsupporting schemas\n\n## Approach\n\nDescriptions only — no schema types, validation constraints, or field\nnames changed. Rebased onto main to pick up #262927 (styling alignment\nrestructuring).\n\n## What changed\n\n### Operation schemas\n- `metric_ops.ts`: object-level descriptions on\n`metricOperationDefinitionSchema`,\n`fieldMetricOrFormulaOperationDefinitionSchema`\n- `bucket_ops.ts`: descriptions on `bucketOperationDefinitionSchema` and\nall bucket operation fields; `When \\`true\\`,` pattern applied throughout\n- `shared.ts`: fixed tautological `collapseBySchema` description; fixed\n`ignore_global_filters` and `sampling` descriptions; fixed\n`axisTitleSchemaProps`\n\n### Chart schemas — all 12 types\nObject-level descriptions on DSL variant, ES|QL variant, and union\nschema for every chart type. \"DSL data source\" consistently replaced\nwith \"data view\". Additional field-level descriptions on chart-specific\nfields (shape, alignment, icon, palette, etc.).\n\n### Supporting schemas\n- `color.ts`: descriptions on all color variant schemas; full palette\nname list on all palette fields with correct defaults per context\n- `format.ts`: descriptions on all format variant schemas\n- `filter.ts`: descriptions on `filterSchema` and\n`filterWithLabelSchema`\n- `index.ts`: description on `lensApiStateSchema` top-level union\n- `xy.ts`: `aggregate_first` description fixed\n\n### Style quality pass\n- All descriptions standardised to noun phrases (no verb-first\ndescriptions)\n- `A/An` added to concrete countable noun descriptions\n- Dropped valid enum values restored (alignment, slice label position,\ndonut hole size)\n- Redundant numeric min/max removed from description text (auto-rendered\nby OAS)\n- `may` → `can` throughout\n\n### Reverted\nObject-level descriptions added to `@kbn/as-code-data-views-schema`\n(`dataViewReferenceSchema`, `dataViewSpecSchema`, `runtimeFieldSchema`,\netc.) were **reverted** — object-level `meta.description` on schema\nobjects in shared packages does not surface in the OAS output. Will use\noverlay fallback.\n\n## Test plan\n- [x] Rebased onto main; conflicts from #262927 resolved\n- [x] Descriptions verified in combined OAS preview on Bump\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>\nCo-authored-by: florent-leborgne <10208282+florent-leborgne@users.noreply.github.com>\nCo-authored-by: Marco Vettorello <vettorello.marco@gmail.com>","sha":"187a8e0c74b9cd78b0b963e3abf92211bc0a7939"}}]}] BACKPORT--> Co-authored-by: Florent LB <florent.leborgne@elastic.co> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: florent-leborgne <10208282+florent-leborgne@users.noreply.github.com> Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
smith
pushed a commit
to smith/kibana
that referenced
this pull request
Apr 28, 2026
…pes (Viz PR B) (elastic#263571) ## Summary Part of the Lens Visualizations API documentation series (Viz PR B). Adds descriptions to all 12 chart type schemas and all supporting schemas. **Series:** - PR 1/4: Introduction overlay — merged (elastic#262595) - PR 2/4: Endpoint + field descriptions (elastic#263151) - PR 3/4: Code samples + response examples (elastic#262874) - **Viz PR B (this PR):** Schema descriptions for all 12 chart types + supporting schemas ## Approach Descriptions only — no schema types, validation constraints, or field names changed. Rebased onto main to pick up elastic#262927 (styling alignment restructuring). ## What changed ### Operation schemas - `metric_ops.ts`: object-level descriptions on `metricOperationDefinitionSchema`, `fieldMetricOrFormulaOperationDefinitionSchema` - `bucket_ops.ts`: descriptions on `bucketOperationDefinitionSchema` and all bucket operation fields; `When \`true\`,` pattern applied throughout - `shared.ts`: fixed tautological `collapseBySchema` description; fixed `ignore_global_filters` and `sampling` descriptions; fixed `axisTitleSchemaProps` ### Chart schemas — all 12 types Object-level descriptions on DSL variant, ES|QL variant, and union schema for every chart type. "DSL data source" consistently replaced with "data view". Additional field-level descriptions on chart-specific fields (shape, alignment, icon, palette, etc.). ### Supporting schemas - `color.ts`: descriptions on all color variant schemas; full palette name list on all palette fields with correct defaults per context - `format.ts`: descriptions on all format variant schemas - `filter.ts`: descriptions on `filterSchema` and `filterWithLabelSchema` - `index.ts`: description on `lensApiStateSchema` top-level union - `xy.ts`: `aggregate_first` description fixed ### Style quality pass - All descriptions standardised to noun phrases (no verb-first descriptions) - `A/An` added to concrete countable noun descriptions - Dropped valid enum values restored (alignment, slice label position, donut hole size) - Redundant numeric min/max removed from description text (auto-rendered by OAS) - `may` → `can` throughout ### Reverted Object-level descriptions added to `@kbn/as-code-data-views-schema` (`dataViewReferenceSchema`, `dataViewSpecSchema`, `runtimeFieldSchema`, etc.) were **reverted** — object-level `meta.description` on schema objects in shared packages does not surface in the OAS output. Will use overlay fallback. ## Test plan - [x] Rebased onto main; conflicts from elastic#262927 resolved - [x] Descriptions verified in combined OAS preview on Bump 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: florent-leborgne <10208282+florent-leborgne@users.noreply.github.com> Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds cURL and Console code samples and inlined response examples to all 5 Visualizations API endpoints.
Code samples (
x-codeSamples)POST /api/visualizationsdata_view_spec); XY line chart; Pie/donut chart; Data table; Metric chart (data_view_reference)GET /api/visualizationsGET /api/visualizations/{id}PUT /api/visualizations/{id}DELETE /api/visualizations/{id}Each example has a cURL and Console variant. The
esqldata source is not covered — it is not yet supported by the Visualizations API (returns 400); use the Dashboards API for ES|QL visualizations.Response examples
POST /api/visualizationsGET /api/visualizationsGET /api/visualizations/{id}PUT /api/visualizations/{id}All payloads tested against a live Kibana 9.4.0 instance using the Kibana sample logs dataset.
Preview
https://bump.sh/elastic/hub/elastic-apis/doc/visualizations-api-cleanup-intro-get-started/group/endpoint-visualizations
Test plan
🤖 Generated with Claude Code