Skip to content

Commit 98499af

Browse files
authored
create_service_token should use POST is name is empty (#862)
1 parent 264743b commit 98499af

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

internal/build/cmd/generate/commands/gensource/generator.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,15 @@ func (r ` + g.Endpoint.MethodWithNamespace() + `Request) Do(providedCtx context.
526526
method = "POST"
527527
}`)
528528
g.w("\n\n")
529+
case "security.create_service_token":
530+
g.w("\t")
531+
g.w(`if r.Name != "" {
532+
method = "POST"
533+
} else {
534+
method = "PUT"
535+
}`)
536+
g.w("\n\n")
537+
529538
default:
530539
var httpMethod string
531540
// If endpoint has both GET and POST available

0 commit comments

Comments
 (0)