Skip to content

Label the API map row property name* instead of <string> - #5024

Merged
reakaleek merged 8 commits into
mainfrom
autoscaling-docs-object-366b2b81
Nov 24, 2026
Merged

reakaleek merged 8 commits into
mainfrom
autoscaling-docs-object-366b2b81

Conversation

@reakaleek

@reakaleek reakaleek commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

The row that lists a map's value fields in API property trees now reads property name* with an additional property label, in place of a <string> chip. It no longer looks like a field named <string>.

Affects: API reference

Prompt summary: Explain why the autoscaling capacity response shows <string> of type object, which looks wrong, and note that Bump.sh shows it differently. The author then asked for research on how other API docs label this row and picked the best label for ours.

Why

policies in the autoscaling.get_autoscaling_capacity response is a map: additionalProperties points at an object schema. The tree builder adds one row under a map to hold the value's fields, and it labelled that row <string> in the name column. Next to the type object, it read as a field called <string>. It also repeated the string already in the parent's map string to object.

Other API docs avoid this. A rendered check shows what each one does with the same kind of schema:

Tool Name column Extra label
Redoc 2.1.5 property name* additional property
Swagger UI 5.17 < * > none (examples use additionalProp1)
Bump.sh (the current Elastic API docs) * Additional properties

All three mark the row with an asterisk. None puts a type placeholder in the name column. Redoc's wording is the only one that says what the row is without prior knowledge, so this PR follows it. The additional property label also matches the OpenAPI term additionalProperties.

What

The map row label

The row under a map now shows property name* in the name column and a muted additional property label after it. One partial, _MapKeyLabel, draws it. The label reuses the existing values-label style, so there is no new CSS. The hover tooltip shows the JSON path with *, the JSONPath wildcard, for the key (policies.*).

What stays the same

ApiPropertyPath.MapKeyMarker (<string>) is still the marker in JSON paths and in the search index, so indexed field paths do not change. Row anchors such as #query-tags-string stay, so existing deep links keep working. The Markdown export still says Map values (object), because plain text for LLMs reads better with words than with an asterisk.

Map bodies and union variants

A map at the root of a body, and a map on a oneOf variant, get their key row from a property that the builder names <string>. That row goes through the regular property path, so ApiProperty.IsMapKey sends it to the same partial. A map reads the same wherever it appears in a schema.

Summary, links and permalinks

Other text that named the key row now agrees with it. The collapsed request-body summary lists property name* for a map body. A "Same fields as" link to a key row reads property name*. A permalink announces the key as additional property, such as Link to aggs.additional property.terms, so a screen reader never hears <string> or skips a bare *. Only a whole <string> segment counts, so a field such as value<string> keeps its name. The Markdown export keeps the raw names.

Snapshots

Render_ReferencedMapParameter_ShowsKeyRowInQuerySection.verified.html shows the new row, and new snapshots cover a map body, a map on a union variant, and the repeat link.

Verify

mise run test
mise run journeys:test
mise run serve
# open http://localhost:3000/api/elasticsearch/v8/operation/operation-autoscaling-get-autoscaling-capacity
# the rows under `policies` and `deciders` read `property name*` and `additional property`

Check on the preview

🤖 Generated with Claude Code

The row that holds a map's value fields read `<string>` in the name column, so it looked like a field named `<string>` of type `object`. The parent row already says `map string to object`. Redoc, Swagger UI and Bump.sh all mark this row with an asterisk and no type placeholder.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@reakaleek
reakaleek requested a review from a team as a code owner November 23, 2026 21:53
@reakaleek
reakaleek requested a review from technige November 23, 2026 21:53
A map body and a map on a `oneOf` variant get their key row from `WithDictionaryKeyRow`, which adds a property named `<string>` to a plain property list. That row skipped the new label and still read `<string>`. `_MapKeyLabel` now draws the row's label, and the plain row path uses it for `ApiProperty.IsMapKey`, so one map reads the same wherever it appears. Review finding on the PR.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

reakaleek and others added 3 commits November 23, 2026 23:17
The collapsed request-body summary listed a map body's key row as `<string>`, while the expanded tree reads `property name*`. The summary now takes each row's `DisplayName`, which `ApiProperty` derives from the same constant the key row partial uses. Review finding on the PR.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
When union variants share a map value, a later variant links back to the first key row with "Same fields as". The link read `<string>`, though the row it points at reads `property name*`. `RepeatedShape` now has a `DisplayName` for the page and keeps its raw `Name`, so the Markdown export is unchanged. Review finding on the PR.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A row's permalink is announced as "Link to" plus its JSON path or name, so a screen reader still heard `<string>` for a map key, such as `Link to tags.<string>`. The path now reads `*` for the key, as the visible row does, and a key row with no path reads `property name*`. The tooltip keeps the full path. Review finding on the PR.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@reakaleek
reakaleek marked this pull request as draft November 23, 2026 22:32
reakaleek and others added 3 commits November 23, 2026 23:34
The permalink label replaced every `<string>` in the JSON path, so a field such as `settings.value<string>` was announced as `settings.value*` even with no map in the path. A segment now reads as a map key only when it is `<string>`, with any `[]` after it. Review finding on the PR.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A permalink to a root map's key row was announced as `Link to *`, which a screen reader can skip. The map key in a permalink now reads `additional property`, the same words the row shows beside its label, and a key row with no path reads the same. `MapKeyKind` holds the words for both. Review finding on the PR.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The hover tooltip on a row shows its JSON path, and `*` is how JSONPath writes "any key". A path through a map read `tags.<string>`, which is only our internal marker for the search index. The tooltip now reads `tags.*`. The marker and the index are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@reakaleek
reakaleek marked this pull request as ready for review November 24, 2026 07:46
@reakaleek
reakaleek merged commit e5d96f3 into main Nov 24, 2026
48 of 49 checks passed
@reakaleek
reakaleek deleted the autoscaling-docs-object-366b2b81 branch November 24, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant