Repository navigation
Read single-or-array rows as "Rescore or Rescore[]" - #4380
Merged
Merged
Conversation
A field such as `rescore` read "A single Rescore or an array of them" under its description. "Rescore or Rescore[]" says the same in the notation the rest of the explorer uses, as the "Like or Like[]" label of a nested union already does. The Markdown export reads the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
||
| if (property.SingleOrArrayOf is { } single) | ||
| WriteNestedLine(markdown, depth, $"A single `{single}` or an array of them"); | ||
| WriteNestedLine(markdown, depth, $"`{single}` or `{single}[]`"); |
There was a problem hiding this comment.
Severity: P2 (Medium)
For map-valued rows, appending [] to the label makes the array option look like a map whose values are arrays, rather than an array of maps.
Generated by Libra. React with 👍 or 👎 to give feedback on this comment.
Contributor
Author
There was a problem hiding this comment.
Fixed in 0937a08. A map's array form now takes the [] in front, "[] map string to HighlightField", the prefix type annotations use for arrays, so it reads as an array of maps. Named types keep "Rescore[]". BuildPropertyList_SingleOrArrayRowListingFields_SaysAnArrayIsAccepted checks both spellings.
"map string to HighlightField[]" read as a map whose values are arrays, not an array of maps. A map's array form now reads "[] map string to HighlightField", the prefix type annotations use for arrays. Named types keep "Rescore[]". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4380/ |
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.
API Explorer rows typed
X | X[]that list the fields ofX, such asrescore, now read "Rescore or Rescore[]" instead of "A single Rescore or an array of them".Affects:
API referencePrompt summary: The author asked to replace the wording "A single Rescore or an array of them" with "Rescore or Rescore[]".
Why
The line added in #4370 spelled out in prose what the rest of the API Explorer writes as type notation. A nested union's label already reads "Like or Like[]; each Like is one of:", so the two forms of the same idea read differently.
What
Type notation instead of prose
The line now shows the two shapes as code,
XandX[], joined by "or" in the same style as option rows. A map reads "map string to HighlightField or [] map string to HighlightField", with the[]in front as type annotations write arrays, since a trailing[]would read as a map of arrays. The Markdown export reads "RescoreorRescore[]".Where to look
rescorecollapse.inner_hits.highlight.fieldsVerify
dotnet run --project tests/Elastic.ApiExplorer.Tests # BuildPropertyList_SingleOrArrayRowListingFields_SaysAnArrayIsAccepted🤖 Generated with Claude Code