Skip to content

Commit

Permalink
create_service_token should use POST is name is empty (#862)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anaethelion authored May 24, 2024
1 parent 264743b commit 98499af
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/build/cmd/generate/commands/gensource/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,15 @@ func (r ` + g.Endpoint.MethodWithNamespace() + `Request) Do(providedCtx context.
method = "POST"
}`)
g.w("\n\n")
case "security.create_service_token":
g.w("\t")
g.w(`if r.Name != "" {
method = "POST"
} else {
method = "PUT"
}`)
g.w("\n\n")

default:
var httpMethod string
// If endpoint has both GET and POST available
Expand Down

0 comments on commit 98499af

Please sign in to comment.