-
Notifications
You must be signed in to change notification settings - Fork 99
[OpenAPI] Lift enum member descriptions in property descriptions #4313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
writeln!(result)?; | ||
writeln!(result)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this double line expected?
@lcawl should we go ahead with this update? |
If @lcawl is ok with the update, I would love to see this go live so we can have enum descriptions in our API docs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I committed two suggested changes to the text (from "Values are" to "Supported values include:") and ran make compiler-wasm-lib
locally to see the impact. I haven't checked in the regenerated output since my local tests also affected compiler-rs
files that I'm unfamiliar with. If you regenerate the output and are happy with my text changes, it LGTM.
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-9.0 9.0
# Navigate to the new working tree
cd .worktrees/backport-9.0
# Create a new branch
git switch --create backport-4313-to-9.0
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 4fb0647c90c2e8aa4979a035a7833170b1035d2f
# Push it to GitHub
git push --set-upstream origin backport-4313-to-9.0
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-9.0 Then, create a pull request where the |
Co-authored-by: Lisa Cawley <[email protected]> Co-authored-by: Laura Trotta <[email protected]> (cherry picked from commit 4fb0647)
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
#4313) (#4350) * [OpenAPI] Lift enum member descriptions in property descriptions (#4313) Co-authored-by: Lisa Cawley <[email protected]> Co-authored-by: Laura Trotta <[email protected]> (cherry picked from commit 4fb0647) * regen --------- Co-authored-by: Sylvain Wallez <[email protected]> Co-authored-by: Laura Trotta <[email protected]>
Co-authored-by: Lisa Cawley <[email protected]> Co-authored-by: Laura Trotta <[email protected]> (cherry picked from commit 4fb0647)
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
Co-authored-by: Lisa Cawley <[email protected]> Co-authored-by: Laura Trotta <[email protected]> (cherry picked from commit 4fb0647)
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
…) (#4355) (cherry picked from commit 4fb0647) Co-authored-by: Sylvain Wallez <[email protected]> Co-authored-by: Laura Trotta <[email protected]>
…) (#4354) (cherry picked from commit 4fb0647) Co-authored-by: Sylvain Wallez <[email protected]> Co-authored-by: Laura Trotta <[email protected]>
The OpenAPI spec doesn't support adding descriptions to enumeration members. This PR fixes that by having the OpenAPI converter lift enum member descriptions in the descriptions of properties of an enum type.
It also handles aliases, enum arrays and lenient arrays (e.g.
Foo | Foo[]
).Rendering in bump.sh
Enumerations with no descriptions are left unchanged
Caveat: for unary values (i.e. not an array or lenient array), bump.sh will still render its list below the descriptions added by this PR. This could be avoided by removing the enumeration values from the OpenAPI spec (and keep them only in the docs), but this would remove some information from that OpenAPI spec.
Example