From d7ddfcefaf919400d052b9741eb4f61163c6da62 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 02:57:00 +0000 Subject: [PATCH 1/6] fix: fix for test cases with newlines in YAML and better error reporting --- pkg/cmd/flagoptions.go | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pkg/cmd/flagoptions.go b/pkg/cmd/flagoptions.go index 533ebab..9aee10d 100644 --- a/pkg/cmd/flagoptions.go +++ b/pkg/cmd/flagoptions.go @@ -227,19 +227,20 @@ func flagOptions( if len(pipeData) > 0 { var bodyData any - if err := yaml.Unmarshal(pipeData, &bodyData); err == nil { - if bodyMap, ok := bodyData.(map[string]any); ok { - if flagMap, ok := requestContents.Body.(map[string]any); ok { - maps.Copy(bodyMap, flagMap) - requestContents.Body = bodyMap - } else { - bodyData = requestContents.Body - } - } else if flagMap, ok := requestContents.Body.(map[string]any); ok && len(flagMap) > 0 { - return nil, fmt.Errorf("Cannot merge flags with a body that is not a map: %v", bodyData) + if err := yaml.Unmarshal(pipeData, &bodyData); err != nil { + return nil, fmt.Errorf("Failed to parse piped data as YAML/JSON:\n%w", err) + } + if bodyMap, ok := bodyData.(map[string]any); ok { + if flagMap, ok := requestContents.Body.(map[string]any); ok { + maps.Copy(bodyMap, flagMap) + requestContents.Body = bodyMap } else { - requestContents.Body = bodyData + bodyData = requestContents.Body } + } else if flagMap, ok := requestContents.Body.(map[string]any); ok && len(flagMap) > 0 { + return nil, fmt.Errorf("Cannot merge flags with a body that is not a map: %v", bodyData) + } else { + requestContents.Body = bodyData } } } From 52672203d05f44f607fe899527027ba207ce97c3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 17:25:05 +0000 Subject: [PATCH 2/6] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d6227e8..34d4722 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 22 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-ef33241ec003fafbf4f2ffe434c3d8c2ac0ba929137942185663ff59974d2138.yml openapi_spec_hash: 87bd0d9c684517522cbbbd48bbe8ad83 -config_hash: 038aa9961f259a8ee53e61dfb2454763 +config_hash: 319ed5c667c4fa3dd8dc57368293e074 From 78d11c86f451aa840099422ead40307bebd1858e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 17:25:25 +0000 Subject: [PATCH 3/6] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 34d4722..0b3b470 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 22 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-ef33241ec003fafbf4f2ffe434c3d8c2ac0ba929137942185663ff59974d2138.yml openapi_spec_hash: 87bd0d9c684517522cbbbd48bbe8ad83 -config_hash: 319ed5c667c4fa3dd8dc57368293e074 +config_hash: 63178ec4b1d2ea5636c8619cffcf129b From ace94ad5a0ee88b334b5752e12cfa8c60e9a88ca Mon Sep 17 00:00:00 2001 From: Young-Jin Park Date: Thu, 12 Mar 2026 18:47:30 -0400 Subject: [PATCH 4/6] fix: fix auth --- pkg/cmd/cmdutil.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/cmdutil.go b/pkg/cmd/cmdutil.go index d23fce0..f271454 100644 --- a/pkg/cmd/cmdutil.go +++ b/pkg/cmd/cmdutil.go @@ -39,8 +39,14 @@ func getDefaultRequestOptions(cmd *cli.Command) []option.RequestOption { option.WithHeader("X-Stainless-Package-Version", Version), option.WithHeader("X-Stainless-Runtime", "cli"), option.WithHeader("X-Stainless-CLI-Command", cmd.FullName()), - option.WithAPIKey(cmd.String("api-key")), - option.WithProject(cmd.String("project")), + } + + if cmd.IsSet("api-key") { + opts = append(opts, option.WithAPIKey(cmd.String("api-key"))) + } + + if cmd.IsSet("project") { + opts = append(opts, option.WithProject(cmd.String("project"))) } // Override base URL if the --base-url flag is provided From 74a2a46a697ca526395d7ee360c54204d5f86656 Mon Sep 17 00:00:00 2001 From: Young-Jin Park Date: Thu, 12 Mar 2026 18:56:57 -0400 Subject: [PATCH 5/6] fix: fix api-key being passed into command --- internal/requestflag/requestflag.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/requestflag/requestflag.go b/internal/requestflag/requestflag.go index 986afed..7698744 100644 --- a/internal/requestflag/requestflag.go +++ b/internal/requestflag/requestflag.go @@ -28,6 +28,7 @@ type Flag[ Sources cli.ValueSourceChain // sources to load flag value from Required bool // whether the flag is required or not Hidden bool // whether to hide the flag in help output + Local bool // whether or not this flag should be applied to subcommands Default T // default value for this flag if not set by from any source Aliases []string // aliases that are allowed for this flag Validator func(T) error // custom function to validate this flag value @@ -55,6 +56,10 @@ type InRequest interface { IsBodyRoot() bool } +func (f Flag[T]) IsLocal() bool { + return f.Local +} + func (f Flag[T]) GetQueryPath() string { return f.QueryPath } From 05773fa15e101174707425d0b2b0f949f9adf503 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 22:57:15 +0000 Subject: [PATCH 6/6] release: 0.1.0-alpha.82 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 10 ++++++++++ pkg/cmd/version.go | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1547b99..cf60623 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.81" + ".": "0.1.0-alpha.82" } diff --git a/CHANGELOG.md b/CHANGELOG.md index e238eb1..38bceb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 0.1.0-alpha.82 (2026-03-12) + +Full Changelog: [v0.1.0-alpha.81...v0.1.0-alpha.82](https://github.com/stainless-api/stainless-api-cli/compare/v0.1.0-alpha.81...v0.1.0-alpha.82) + +### Bug Fixes + +* fix api-key being passed into command ([74a2a46](https://github.com/stainless-api/stainless-api-cli/commit/74a2a46a697ca526395d7ee360c54204d5f86656)) +* fix auth ([ace94ad](https://github.com/stainless-api/stainless-api-cli/commit/ace94ad5a0ee88b334b5752e12cfa8c60e9a88ca)) +* fix for test cases with newlines in YAML and better error reporting ([d7ddfce](https://github.com/stainless-api/stainless-api-cli/commit/d7ddfcefaf919400d052b9741eb4f61163c6da62)) + ## 0.1.0-alpha.81 (2026-03-11) Full Changelog: [v0.1.0-alpha.80...v0.1.0-alpha.81](https://github.com/stainless-api/stainless-api-cli/compare/v0.1.0-alpha.80...v0.1.0-alpha.81) diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go index caefff0..23013c3 100644 --- a/pkg/cmd/version.go +++ b/pkg/cmd/version.go @@ -2,4 +2,4 @@ package cmd -const Version = "0.1.0-alpha.81" // x-release-please-version +const Version = "0.1.0-alpha.82" // x-release-please-version