-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: shorten protobufAny text in HCP Vault API docs #2446
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
π¦ Next.js Bundle AnalysisThis analysis was generated by the next.js bundle analysis action π€ This PR introduced no changes to the javascript bundle π |
* This is done as we don't want to display the full descriptions of | ||
* `protobufAny`, since they were too long in the context of the UI. | ||
*/ | ||
function shortenProtobufAnyDescription( |
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.
This is the main focus of this PR, the rest is mostly just refactoring to make using this function possible, and to build some consistency in schema modifications across the exist consumers of the OpenAPI docs view.
@pbortnick This PR is a somewhat temporary content modification for the HCP Vault Secrets API docs! Apart from the content change, this also seems to fix an issue where previous versions of the docs would fail incremental static regeneration, because the page response size would be big enough that the lambda rendering the page would have trouble. It seems that shortening the description here puts the page back under the threshold needed for incremental static regeneration to function as expected. Happy to add any other context as needed! πββοΈ |
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.
Looks way better!
π Relevant links
ποΈ What
Modifies the OpenAPI schema for HCP Vault Secrets to replace long descriptions in the
protobufAny
schema with shorter descriptions.π€· Why
The long descriptions for
protobufAny
we currently have in production feel more distracting that useful.Ideally, we'd shorten these descriptions in the content source. However, making this adjustment isn't currently something that feels easy to reach for.
π οΈ How
massageSchemaForClient
hook to happen before the OpenAPI schema is dereferencedschemaModProtobufAny
, which replaces the long descriptions we want to address with shorter onesschemaModComponent
, which we could use to modify other referenced component schemas, not justprotobufAny
schemaModShortenHcp
to replaceHashiCorp Cloud Platform
withHCP
in OpenAPI schema titles, as this exact functionality is used across all our HCP OpenAPI docs so farπΈ Design Screenshots
π§ͺ Testing
Visit /hcp/api-docs/vault-secrets on the preview
protobufAny
, which are often referenced in default error responses, should be a reasonable length, yet still provide useful informationOther OpenAPI docs views should be rendering as they are upstream, without changes
protobufAny
descriptions, but for now, we're scoping this adjustment to HCP Vault Secrets API docs only.π Anything else?
Not at the moment!