Skip to content

Commit

Permalink
[WAYP-2783] Add support for a "hidden" tag for api-docs (#2565)
Browse files Browse the repository at this point in the history
This allows us to tag RPCs as `hidden` to prevent them appearing in
API docs.

Looks like this in practice:

    rpc UI_LoadProductBanner(UI.LoadProductBannerRequest) returns (UI.LoadProductBannerResponse) {
      option (google.api.http) = {
        get: "/waypoint/2023-08-18/namespace/{namespace.id}/ui/product-banner"
      };
      option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
        tags: ["WaypointService", "hidden"]
      };
    }
  • Loading branch information
jgwhite authored Sep 12, 2024
1 parent 24199bc commit 18b7c28
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/views/open-api-docs-view/utils/get-operation-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export async function getOperationProps(
continue
}

if (operation.tags?.includes('hidden')) {
continue
}

// Create a slug for this operation
const operationSlug = slugify(operation.operationId)

Expand Down

0 comments on commit 18b7c28

Please sign in to comment.