From 26ae591f7c610613becadd3c56f560a1420cd037 Mon Sep 17 00:00:00 2001 From: Will Vedder Date: Thu, 12 Jan 2023 16:38:25 -0500 Subject: [PATCH] Prevent showing specific message if JSON flag is passed --- internal/cli/apis.go | 2 +- internal/display/apis.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/cli/apis.go b/internal/cli/apis.go index 544f61e3e..abee9b8ff 100644 --- a/internal/cli/apis.go +++ b/internal/cli/apis.go @@ -177,7 +177,7 @@ func showApiCmd(cli *cli) *cobra.Command { return fmt.Errorf("Unable to get an API with Id '%s': %w", inputs.ID, err) } - cli.renderer.ApiShow(api) + cli.renderer.ApiShow(api, cli.json) return nil }, } diff --git a/internal/display/apis.go b/internal/display/apis.go index 8452f668e..b870935fd 100644 --- a/internal/display/apis.go +++ b/internal/display/apis.go @@ -88,11 +88,11 @@ func (r *Renderer) ApiList(apis []*management.ResourceServer) { r.Results(results) } -func (r *Renderer) ApiShow(api *management.ResourceServer) { +func (r *Renderer) ApiShow(api *management.ResourceServer, jsonFlag bool) { r.Heading("api") view, scopesTruncated := makeApiView(api) r.Result(view) - if scopesTruncated { + if scopesTruncated && !jsonFlag { r.Newline() r.Infof("Scopes truncated for display. To see the full list, run %s", ansi.Faint(fmt.Sprintf("apis scopes list %s", *api.ID))) }