Skip to content

[Docs][Dashboards API] Add field descriptions to controls schemas#263282

Merged
florent-leborgne merged 18 commits into
mainfrom
dashboards-api-docs-2d
Apr 24, 2026
Merged

[Docs][Dashboards API] Add field descriptions to controls schemas#263282
florent-leborgne merged 18 commits into
mainfrom
dashboards-api-docs-2d

Conversation

@florent-leborgne
Copy link
Copy Markdown
Member

@florent-leborgne florent-leborgne commented Apr 15, 2026

Summary

Adds API documentation descriptions to the shared controls schemas package (@kbn/controls-schemas). These schemas are used by both the Dashboards API and Discover — all descriptions are intentionally API-agnostic (they refer to "the control" rather than "the dashboard").

Files changed

File Descriptions added
control_schema.ts 2 (use_global_filters, ignore_validations)
controls_group_schema.ts 3 (width improved, grow added, 4 object-level description+title fields)
options_list_schema.ts 20 (all fields in display settings, search technique, sort, selection, DSL control, and ES
range_slider_schema.ts 2 (value/rangeValueSchema, step)
time_slider_schema.ts 3 (start_percentage_of_time_range, end_percentage_of_time_range, is_anchored)

Total: ~30 descriptions added or improved.

Style followed

  • All descriptions end with a period.
  • Backticks used for field names, literals, and values.
  • Boolean fields follow the pattern: When \true`, [behaviour]. Defaults to `X`.`
  • Enum/oneOf fields enumerate valid values with explanations and state the default.
  • Object-level schemas (discriminatedUnion variants) received description and title in their meta block.
  • ES|QL variable controls are consistently referred to as "ES|QL variable controls" to make the connection to the ?variable_name syntax explicit.

On Defaults to X in description text

defaultValue, min, and max in the schema all generate default, minimum, and maximum in the OAS output, which Bump renders automatically. To avoid redundancy:

  • Numeric min/max are not repeated in descriptions — they are already surfaced as OAS constraints.
  • Defaults to X is kept for boolean and enum fields. For booleans, the default is important context that is easy to miss in the constraints section; stating it inline with the behaviour description makes the field immediately scannable. For enum fields, the default is kept as part of the sentence that also explains valid values, since splitting them would reduce readability.

Fields intentionally skipped

  • display_settings (top-level object wrapper) — no description added; the individual child fields (placeholder, hide_*) are described instead.
  • optionsListSelectionSchema — inline oneOf helper; description added at the selected_options array level which is the consumer-visible field.

Test plan

  • Verify no TypeScript errors: node scripts/type_check --project src/platform/packages/shared/controls/controls-schemas/tsconfig.json
  • Verify no lint errors: node scripts/eslint src/platform/packages/shared/controls/controls-schemas/src/
  • Confirm OAS output reflects new descriptions by regenerating the OAS bundle

API-agnostic descriptions for the shared controls schemas used by the Dashboards
and Discover APIs. Adds missing descriptions to control panel fields, options list
configuration, range slider, and time slider schemas.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
florent-leborgne and others added 3 commits April 16, 2026 15:11
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Remove internal jargon ('control group', 'control popover', 'action bar')
- Use 'ES|QL variable control' consistently for esql_control type
- Clarify search_technique: wildcard = contains, only string/IP fields
- Fix 'may' → 'can' in single_select descriptions
- Fix 'regardless of value' → 'regardless of the field's value'
- Remove redundant min/max/default from descriptions (already in OAS constraints)
- Simplify range slider and ES|QL variable control object descriptions

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…der descriptions

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@florent-leborgne florent-leborgne added Team:Docs release_note:skip Skip the PR/issue when compiling release notes docs APIDocs backport:version Backport to applied version labels v9.4.0 labels Apr 16, 2026
@florent-leborgne florent-leborgne marked this pull request as ready for review April 16, 2026 15:05
@florent-leborgne florent-leborgne requested a review from a team as a code owner April 16, 2026 15:05
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/experience-docs (Team:Docs)

Comment thread src/platform/packages/shared/controls/controls-schemas/src/control_schema.ts Outdated
Comment thread src/platform/packages/shared/controls/controls-schemas/src/control_schema.ts Outdated
Comment thread src/platform/packages/shared/controls/controls-schemas/src/control_schema.ts Outdated
florent-leborgne added a commit that referenced this pull request Apr 16, 2026
…dpoints (#262865)

## Summary

- Adds cURL and Console code samples (`x-codeSamples`) to all 5
Dashboards API endpoints (POST, GET `/{id}`, PUT `/{id}`, DELETE
`/{id}`, GET `_find`)
- POST includes two examples: simple dashboard (markdown + 2 metrics +
ES|QL line chart) and a structured dashboard with sections and controls
- Adds inlined response examples for POST (201), GET (200), PUT (200),
and GET `_find` (200)

All examples tested against a live Kibana 9.4.0 instance using the
Kibana sample logs dataset (`kibana_sample_data_logs`). Follows the grid
best practices documented in the tag description (PR #262396).

Part of the Dashboards API documentation series: #262396 (merged) →
descriptions (#263166, #263281, #263282, #263283) → this PR.

## Preview


https://bump.sh/elastic/hub/elastic-apis/doc/dashboards-api-cleanup-intro-and-get-started/group/endpoint-dashboards

## Test plan

- [ ] Generate Bump preview and verify code samples appear in upper
right dropdown for each endpoint
- [ ] Verify response examples appear in the Responses section
- [ ] 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>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 16, 2026
…dpoints (elastic#262865)

## Summary

- Adds cURL and Console code samples (`x-codeSamples`) to all 5
Dashboards API endpoints (POST, GET `/{id}`, PUT `/{id}`, DELETE
`/{id}`, GET `_find`)
- POST includes two examples: simple dashboard (markdown + 2 metrics +
ES|QL line chart) and a structured dashboard with sections and controls
- Adds inlined response examples for POST (201), GET (200), PUT (200),
and GET `_find` (200)

All examples tested against a live Kibana 9.4.0 instance using the
Kibana sample logs dataset (`kibana_sample_data_logs`). Follows the grid
best practices documented in the tag description (PR elastic#262396).

Part of the Dashboards API documentation series: elastic#262396 (merged) →
descriptions (elastic#263166, elastic#263281, elastic#263282, elastic#263283) → this PR.

## Preview

https://bump.sh/elastic/hub/elastic-apis/doc/dashboards-api-cleanup-intro-and-get-started/group/endpoint-dashboards

## Test plan

- [ ] Generate Bump preview and verify code samples appear in upper
right dropdown for each endpoint
- [ ] Verify response examples appear in the Responses section
- [ ] 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 f6059b0)
kibanamachine added a commit that referenced this pull request Apr 16, 2026
…l 5 endpoints (#262865) (#263899)

# Backport

This will backport the following commits from `main` to `9.4`:
- [[Docs][Dashboards API] Add request and response examples for all 5
endpoints (#262865)](#262865)

<!--- 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-16T20:16:43Z","message":"[Docs][Dashboards
API] Add request and response examples for all 5 endpoints
(#262865)\n\n## Summary\n\n- Adds cURL and Console code samples
(`x-codeSamples`) to all 5\nDashboards API endpoints (POST, GET `/{id}`,
PUT `/{id}`, DELETE\n`/{id}`, GET `_find`)\n- POST includes two
examples: simple dashboard (markdown + 2 metrics +\nES|QL line chart)
and a structured dashboard with sections and controls\n- Adds inlined
response examples for POST (201), GET (200), PUT (200),\nand GET `_find`
(200)\n\nAll examples tested against a live Kibana 9.4.0 instance using
the\nKibana sample logs dataset (`kibana_sample_data_logs`). Follows the
grid\nbest practices documented in the tag description (PR
#262396).\n\nPart of the Dashboards API documentation series: #262396
(merged) →\ndescriptions (#263166, #263281, #263282, #263283) → this
PR.\n\n##
Preview\n\n\nhttps://bump.sh/elastic/hub/elastic-apis/doc/dashboards-api-cleanup-intro-and-get-started/group/endpoint-dashboards\n\n##
Test plan\n\n- [ ] Generate Bump preview and verify code samples appear
in upper\nright dropdown for each endpoint\n- [ ] Verify response
examples appear in the Responses section\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":"f6059b02aca72b0978a1da87a5c74ccb60e26325","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][Dashboards
API] Add request and response examples for all 5
endpoints","number":262865,"url":"https://github.com/elastic/kibana/pull/262865","mergeCommit":{"message":"[Docs][Dashboards
API] Add request and response examples for all 5 endpoints
(#262865)\n\n## Summary\n\n- Adds cURL and Console code samples
(`x-codeSamples`) to all 5\nDashboards API endpoints (POST, GET `/{id}`,
PUT `/{id}`, DELETE\n`/{id}`, GET `_find`)\n- POST includes two
examples: simple dashboard (markdown + 2 metrics +\nES|QL line chart)
and a structured dashboard with sections and controls\n- Adds inlined
response examples for POST (201), GET (200), PUT (200),\nand GET `_find`
(200)\n\nAll examples tested against a live Kibana 9.4.0 instance using
the\nKibana sample logs dataset (`kibana_sample_data_logs`). Follows the
grid\nbest practices documented in the tag description (PR
#262396).\n\nPart of the Dashboards API documentation series: #262396
(merged) →\ndescriptions (#263166, #263281, #263282, #263283) → this
PR.\n\n##
Preview\n\n\nhttps://bump.sh/elastic/hub/elastic-apis/doc/dashboards-api-cleanup-intro-and-get-started/group/endpoint-dashboards\n\n##
Test plan\n\n- [ ] Generate Bump preview and verify code samples appear
in upper\nright dropdown for each endpoint\n- [ ] Verify response
examples appear in the Responses section\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":"f6059b02aca72b0978a1da87a5c74ccb60e26325"}},"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/262865","number":262865,"mergeCommit":{"message":"[Docs][Dashboards
API] Add request and response examples for all 5 endpoints
(#262865)\n\n## Summary\n\n- Adds cURL and Console code samples
(`x-codeSamples`) to all 5\nDashboards API endpoints (POST, GET `/{id}`,
PUT `/{id}`, DELETE\n`/{id}`, GET `_find`)\n- POST includes two
examples: simple dashboard (markdown + 2 metrics +\nES|QL line chart)
and a structured dashboard with sections and controls\n- Adds inlined
response examples for POST (201), GET (200), PUT (200),\nand GET `_find`
(200)\n\nAll examples tested against a live Kibana 9.4.0 instance using
the\nKibana sample logs dataset (`kibana_sample_data_logs`). Follows the
grid\nbest practices documented in the tag description (PR
#262396).\n\nPart of the Dashboards API documentation series: #262396
(merged) →\ndescriptions (#263166, #263281, #263282, #263283) → this
PR.\n\n##
Preview\n\n\nhttps://bump.sh/elastic/hub/elastic-apis/doc/dashboards-api-cleanup-intro-and-get-started/group/endpoint-dashboards\n\n##
Test plan\n\n- [ ] Generate Bump preview and verify code samples appear
in upper\nright dropdown for each endpoint\n- [ ] Verify response
examples appear in the Responses section\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":"f6059b02aca72b0978a1da87a5c74ccb60e26325"}}]}]
BACKPORT-->

Co-authored-by: Florent LB <florent.leborgne@elastic.co>
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@florent-leborgne florent-leborgne requested a review from a team April 17, 2026 10:48
Copy link
Copy Markdown
Contributor

@Heenawter Heenawter left a comment

Choose a reason for hiding this comment

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

Overall looks great!! Just left two comments :)

Copy link
Copy Markdown
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

Left a few comments

hide_exclude: schema.maybe(schema.boolean()),
hide_exists: schema.maybe(schema.boolean()),
hide_sort: schema.maybe(schema.boolean()),
placeholder: schema.maybe(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's neat to have these extra options well defined. This is a good example of a pattern we'll make more use of in the future, where extra customizability is available via the API that doesn't have a direct way to be set via the UI.

description: 'The list of currently selected option values.',
},
}),
single_select: schema.boolean({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interesting that we have this duplicated rather than reusing the same schema

Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
Co-authored-by: Florent LB <florent.leborgne@elastic.co>
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Apr 24, 2026

💔 Build Failed

Failed CI Steps

Metrics [docs]

‼️ ERROR: metrics for 214d9b3 were not reported

History

Comment thread src/platform/packages/shared/controls/controls-schemas/src/options_list_schema.ts Outdated
@florent-leborgne florent-leborgne merged commit f05e5a9 into main Apr 24, 2026
19 checks passed
@florent-leborgne florent-leborgne deleted the dashboards-api-docs-2d branch April 24, 2026 10:37
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.4

https://github.com/elastic/kibana/actions/runs/24885189369

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
9.4

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Apr 24, 2026
…as (#263282) (#265504)

# Backport

This will backport the following commits from `main` to `9.4`:
- [[Docs][Dashboards API] Add field descriptions to controls schemas
(#263282)](#263282)

<!--- 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-24T10:37:10Z","message":"[Docs][Dashboards
API] Add field descriptions to controls schemas (#263282)\n\n##
Summary\n\nAdds API documentation descriptions to the shared controls
schemas\npackage (`@kbn/controls-schemas`). These schemas are used by
both the\nDashboards API and Discover — all descriptions are
intentionally\nAPI-agnostic (they refer to \"the control\" rather than
\"the dashboard\").\n\n### Files changed\n\n| File | Descriptions added
|\n|---|---|\n| `control_schema.ts` | 2 (`use_global_filters`,
`ignore_validations`) |\n| `controls_group_schema.ts` | 3 (`width`
improved, `grow` added, 4\nobject-level `description`+`title` fields)
|\n| `options_list_schema.ts` | 20 (all fields in display settings,
search\ntechnique, sort, selection, DSL control, and ES|QL variable
control\nvariants) |\n| `range_slider_schema.ts` | 2
(`value`/`rangeValueSchema`, `step`) |\n| `time_slider_schema.ts` | 3
(`start_percentage_of_time_range`,\n`end_percentage_of_time_range`,
`is_anchored`) |\n\n**Total: ~30 descriptions added or
improved.**\n\n### Style followed\n\n- All descriptions end with a
period.\n- Backticks used for field names, literals, and values.\n-
Boolean fields follow the pattern: `When \\`true\\`,
[behaviour].\nDefaults to \\`X\\`.`\n- Enum/oneOf fields enumerate valid
values with explanations and state\nthe default.\n- Object-level schemas
(`discriminatedUnion` variants) received\n`description` and `title` in
their `meta` block.\n- ES|QL variable controls are consistently referred
to as \"ES|QL\nvariable controls\" to make the connection to the
`?variable_name` syntax\nexplicit.\n\n### On `Defaults to X` in
description text\n\n`defaultValue`, `min`, and `max` in the schema all
generate `default`,\n`minimum`, and `maximum` in the OAS output, which
Bump renders\nautomatically. To avoid redundancy:\n\n- **Numeric min/max
are not repeated** in descriptions — they are\nalready surfaced as OAS
constraints.\n- **`Defaults to X` is kept for boolean and enum fields.**
For booleans,\nthe default is important context that is easy to miss in
the constraints\nsection; stating it inline with the behaviour
description makes the\nfield immediately scannable. For enum fields, the
default is kept as\npart of the sentence that also explains valid
values, since splitting\nthem would reduce readability.\n\n### Fields
intentionally skipped\n\n- `display_settings` (top-level object wrapper)
— no description added;\nthe individual child fields (`placeholder`,
`hide_*`) are described\ninstead.\n- `optionsListSelectionSchema` —
inline oneOf helper; description added\nat the `selected_options` array
level which is the consumer-visible\nfield.\n\n## Test plan\n\n- [ ]
Verify no TypeScript errors: `node scripts/type_check
--project\nsrc/platform/packages/shared/controls/controls-schemas/tsconfig.json`\n-
[ ] Verify no lint errors: `node
scripts/eslint\nsrc/platform/packages/shared/controls/controls-schemas/src/`\n-
[ ] Confirm OAS output reflects new descriptions by regenerating
the\nOAS bundle\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:
Hannah Mudge
<Heenawter@users.noreply.github.com>","sha":"f05e5a9ba93c9c99e156bdd898227c44fa80df68","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][Dashboards
API] Add field descriptions to controls
schemas","number":263282,"url":"https://github.com/elastic/kibana/pull/263282","mergeCommit":{"message":"[Docs][Dashboards
API] Add field descriptions to controls schemas (#263282)\n\n##
Summary\n\nAdds API documentation descriptions to the shared controls
schemas\npackage (`@kbn/controls-schemas`). These schemas are used by
both the\nDashboards API and Discover — all descriptions are
intentionally\nAPI-agnostic (they refer to \"the control\" rather than
\"the dashboard\").\n\n### Files changed\n\n| File | Descriptions added
|\n|---|---|\n| `control_schema.ts` | 2 (`use_global_filters`,
`ignore_validations`) |\n| `controls_group_schema.ts` | 3 (`width`
improved, `grow` added, 4\nobject-level `description`+`title` fields)
|\n| `options_list_schema.ts` | 20 (all fields in display settings,
search\ntechnique, sort, selection, DSL control, and ES|QL variable
control\nvariants) |\n| `range_slider_schema.ts` | 2
(`value`/`rangeValueSchema`, `step`) |\n| `time_slider_schema.ts` | 3
(`start_percentage_of_time_range`,\n`end_percentage_of_time_range`,
`is_anchored`) |\n\n**Total: ~30 descriptions added or
improved.**\n\n### Style followed\n\n- All descriptions end with a
period.\n- Backticks used for field names, literals, and values.\n-
Boolean fields follow the pattern: `When \\`true\\`,
[behaviour].\nDefaults to \\`X\\`.`\n- Enum/oneOf fields enumerate valid
values with explanations and state\nthe default.\n- Object-level schemas
(`discriminatedUnion` variants) received\n`description` and `title` in
their `meta` block.\n- ES|QL variable controls are consistently referred
to as \"ES|QL\nvariable controls\" to make the connection to the
`?variable_name` syntax\nexplicit.\n\n### On `Defaults to X` in
description text\n\n`defaultValue`, `min`, and `max` in the schema all
generate `default`,\n`minimum`, and `maximum` in the OAS output, which
Bump renders\nautomatically. To avoid redundancy:\n\n- **Numeric min/max
are not repeated** in descriptions — they are\nalready surfaced as OAS
constraints.\n- **`Defaults to X` is kept for boolean and enum fields.**
For booleans,\nthe default is important context that is easy to miss in
the constraints\nsection; stating it inline with the behaviour
description makes the\nfield immediately scannable. For enum fields, the
default is kept as\npart of the sentence that also explains valid
values, since splitting\nthem would reduce readability.\n\n### Fields
intentionally skipped\n\n- `display_settings` (top-level object wrapper)
— no description added;\nthe individual child fields (`placeholder`,
`hide_*`) are described\ninstead.\n- `optionsListSelectionSchema` —
inline oneOf helper; description added\nat the `selected_options` array
level which is the consumer-visible\nfield.\n\n## Test plan\n\n- [ ]
Verify no TypeScript errors: `node scripts/type_check
--project\nsrc/platform/packages/shared/controls/controls-schemas/tsconfig.json`\n-
[ ] Verify no lint errors: `node
scripts/eslint\nsrc/platform/packages/shared/controls/controls-schemas/src/`\n-
[ ] Confirm OAS output reflects new descriptions by regenerating
the\nOAS bundle\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:
Hannah Mudge
<Heenawter@users.noreply.github.com>","sha":"f05e5a9ba93c9c99e156bdd898227c44fa80df68"}},"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/263282","number":263282,"mergeCommit":{"message":"[Docs][Dashboards
API] Add field descriptions to controls schemas (#263282)\n\n##
Summary\n\nAdds API documentation descriptions to the shared controls
schemas\npackage (`@kbn/controls-schemas`). These schemas are used by
both the\nDashboards API and Discover — all descriptions are
intentionally\nAPI-agnostic (they refer to \"the control\" rather than
\"the dashboard\").\n\n### Files changed\n\n| File | Descriptions added
|\n|---|---|\n| `control_schema.ts` | 2 (`use_global_filters`,
`ignore_validations`) |\n| `controls_group_schema.ts` | 3 (`width`
improved, `grow` added, 4\nobject-level `description`+`title` fields)
|\n| `options_list_schema.ts` | 20 (all fields in display settings,
search\ntechnique, sort, selection, DSL control, and ES|QL variable
control\nvariants) |\n| `range_slider_schema.ts` | 2
(`value`/`rangeValueSchema`, `step`) |\n| `time_slider_schema.ts` | 3
(`start_percentage_of_time_range`,\n`end_percentage_of_time_range`,
`is_anchored`) |\n\n**Total: ~30 descriptions added or
improved.**\n\n### Style followed\n\n- All descriptions end with a
period.\n- Backticks used for field names, literals, and values.\n-
Boolean fields follow the pattern: `When \\`true\\`,
[behaviour].\nDefaults to \\`X\\`.`\n- Enum/oneOf fields enumerate valid
values with explanations and state\nthe default.\n- Object-level schemas
(`discriminatedUnion` variants) received\n`description` and `title` in
their `meta` block.\n- ES|QL variable controls are consistently referred
to as \"ES|QL\nvariable controls\" to make the connection to the
`?variable_name` syntax\nexplicit.\n\n### On `Defaults to X` in
description text\n\n`defaultValue`, `min`, and `max` in the schema all
generate `default`,\n`minimum`, and `maximum` in the OAS output, which
Bump renders\nautomatically. To avoid redundancy:\n\n- **Numeric min/max
are not repeated** in descriptions — they are\nalready surfaced as OAS
constraints.\n- **`Defaults to X` is kept for boolean and enum fields.**
For booleans,\nthe default is important context that is easy to miss in
the constraints\nsection; stating it inline with the behaviour
description makes the\nfield immediately scannable. For enum fields, the
default is kept as\npart of the sentence that also explains valid
values, since splitting\nthem would reduce readability.\n\n### Fields
intentionally skipped\n\n- `display_settings` (top-level object wrapper)
— no description added;\nthe individual child fields (`placeholder`,
`hide_*`) are described\ninstead.\n- `optionsListSelectionSchema` —
inline oneOf helper; description added\nat the `selected_options` array
level which is the consumer-visible\nfield.\n\n## Test plan\n\n- [ ]
Verify no TypeScript errors: `node scripts/type_check
--project\nsrc/platform/packages/shared/controls/controls-schemas/tsconfig.json`\n-
[ ] Verify no lint errors: `node
scripts/eslint\nsrc/platform/packages/shared/controls/controls-schemas/src/`\n-
[ ] Confirm OAS output reflects new descriptions by regenerating
the\nOAS bundle\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:
Hannah Mudge
<Heenawter@users.noreply.github.com>","sha":"f05e5a9ba93c9c99e156bdd898227c44fa80df68"}}]}]
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: Hannah Mudge <Heenawter@users.noreply.github.com>
rbrtj pushed a commit to walterra/kibana that referenced this pull request Apr 27, 2026
…astic#263282)

## Summary

Adds API documentation descriptions to the shared controls schemas
package (`@kbn/controls-schemas`). These schemas are used by both the
Dashboards API and Discover — all descriptions are intentionally
API-agnostic (they refer to "the control" rather than "the dashboard").

### Files changed

| File | Descriptions added |
|---|---|
| `control_schema.ts` | 2 (`use_global_filters`, `ignore_validations`) |
| `controls_group_schema.ts` | 3 (`width` improved, `grow` added, 4
object-level `description`+`title` fields) |
| `options_list_schema.ts` | 20 (all fields in display settings, search
technique, sort, selection, DSL control, and ES|QL variable control
variants) |
| `range_slider_schema.ts` | 2 (`value`/`rangeValueSchema`, `step`) |
| `time_slider_schema.ts` | 3 (`start_percentage_of_time_range`,
`end_percentage_of_time_range`, `is_anchored`) |

**Total: ~30 descriptions added or improved.**

### Style followed

- All descriptions end with a period.
- Backticks used for field names, literals, and values.
- Boolean fields follow the pattern: `When \`true\`, [behaviour].
Defaults to \`X\`.`
- Enum/oneOf fields enumerate valid values with explanations and state
the default.
- Object-level schemas (`discriminatedUnion` variants) received
`description` and `title` in their `meta` block.
- ES|QL variable controls are consistently referred to as "ES|QL
variable controls" to make the connection to the `?variable_name` syntax
explicit.

### On `Defaults to X` in description text

`defaultValue`, `min`, and `max` in the schema all generate `default`,
`minimum`, and `maximum` in the OAS output, which Bump renders
automatically. To avoid redundancy:

- **Numeric min/max are not repeated** in descriptions — they are
already surfaced as OAS constraints.
- **`Defaults to X` is kept for boolean and enum fields.** For booleans,
the default is important context that is easy to miss in the constraints
section; stating it inline with the behaviour description makes the
field immediately scannable. For enum fields, the default is kept as
part of the sentence that also explains valid values, since splitting
them would reduce readability.

### Fields intentionally skipped

- `display_settings` (top-level object wrapper) — no description added;
the individual child fields (`placeholder`, `hide_*`) are described
instead.
- `optionsListSelectionSchema` — inline oneOf helper; description added
at the `selected_options` array level which is the consumer-visible
field.

## Test plan

- [ ] Verify no TypeScript errors: `node scripts/type_check --project
src/platform/packages/shared/controls/controls-schemas/tsconfig.json`
- [ ] Verify no lint errors: `node scripts/eslint
src/platform/packages/shared/controls/controls-schemas/src/`
- [ ] Confirm OAS output reflects new descriptions by regenerating the
OAS bundle

---------

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: Hannah Mudge <Heenawter@users.noreply.github.com>
SoniaSanzV pushed a commit to SoniaSanzV/kibana that referenced this pull request Apr 27, 2026
…astic#263282)

## Summary

Adds API documentation descriptions to the shared controls schemas
package (`@kbn/controls-schemas`). These schemas are used by both the
Dashboards API and Discover — all descriptions are intentionally
API-agnostic (they refer to "the control" rather than "the dashboard").

### Files changed

| File | Descriptions added |
|---|---|
| `control_schema.ts` | 2 (`use_global_filters`, `ignore_validations`) |
| `controls_group_schema.ts` | 3 (`width` improved, `grow` added, 4
object-level `description`+`title` fields) |
| `options_list_schema.ts` | 20 (all fields in display settings, search
technique, sort, selection, DSL control, and ES|QL variable control
variants) |
| `range_slider_schema.ts` | 2 (`value`/`rangeValueSchema`, `step`) |
| `time_slider_schema.ts` | 3 (`start_percentage_of_time_range`,
`end_percentage_of_time_range`, `is_anchored`) |

**Total: ~30 descriptions added or improved.**

### Style followed

- All descriptions end with a period.
- Backticks used for field names, literals, and values.
- Boolean fields follow the pattern: `When \`true\`, [behaviour].
Defaults to \`X\`.`
- Enum/oneOf fields enumerate valid values with explanations and state
the default.
- Object-level schemas (`discriminatedUnion` variants) received
`description` and `title` in their `meta` block.
- ES|QL variable controls are consistently referred to as "ES|QL
variable controls" to make the connection to the `?variable_name` syntax
explicit.

### On `Defaults to X` in description text

`defaultValue`, `min`, and `max` in the schema all generate `default`,
`minimum`, and `maximum` in the OAS output, which Bump renders
automatically. To avoid redundancy:

- **Numeric min/max are not repeated** in descriptions — they are
already surfaced as OAS constraints.
- **`Defaults to X` is kept for boolean and enum fields.** For booleans,
the default is important context that is easy to miss in the constraints
section; stating it inline with the behaviour description makes the
field immediately scannable. For enum fields, the default is kept as
part of the sentence that also explains valid values, since splitting
them would reduce readability.

### Fields intentionally skipped

- `display_settings` (top-level object wrapper) — no description added;
the individual child fields (`placeholder`, `hide_*`) are described
instead.
- `optionsListSelectionSchema` — inline oneOf helper; description added
at the `selected_options` array level which is the consumer-visible
field.

## Test plan

- [ ] Verify no TypeScript errors: `node scripts/type_check --project
src/platform/packages/shared/controls/controls-schemas/tsconfig.json`
- [ ] Verify no lint errors: `node scripts/eslint
src/platform/packages/shared/controls/controls-schemas/src/`
- [ ] Confirm OAS output reflects new descriptions by regenerating the
OAS bundle

---------

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: Hannah Mudge <Heenawter@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

APIDocs backport:version Backport to applied version labels docs release_note:skip Skip the PR/issue when compiling release notes Team:Docs v9.4.0 v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants