[WAYP-2783] Add support for a "hidden" tag for api-docs #2565
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.
π Relevant links
ποΈ What
This allows us to tag RPCs as
hidden
to prevent them appearing in API docs.Looks like this in practice:
π€· Why
We have a set of specialized RPCs in cloud-waypoint-service that are designed only to be used by the UI. We were hoping we could mark these as internal but we realized that means they donβt end up in the generated Swagger at all, and thus donβt make it to our generated API client. At Emily Perssonβs wise suggestion, we are opting to tag these APIs with
hidden
instead, and add some special handling here to ignore methods with that tag.π οΈ How
As youβll see from the diff, this is a small patch to
getOperationProps
that skips over methods with thehidden
tag.πΈ Design Screenshots
N/A
π§ͺ Testing
UI_
-prefixed methods show upπ Docs
Question to the reviewer: Iβd like to document this tag somewhere. Whereβs the best place to do so?
Footnotes
This is the Swagger from https://github.com/hashicorp/cloud-waypoint-service/pull/1390 β©