Skip to content

Commit

Permalink
If loop.count <= 0, Skip step.
Browse files Browse the repository at this point in the history
Fix: #1144
  • Loading branch information
k1LoW committed Jan 9, 2025
1 parent b9d3384 commit bd56419
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ func (op *operator) runStep(ctx context.Context, s *step) error {
if err != nil {
return err
}
if c <= 0 {
// If loop.count <= 0, Skip step
return errStepSkipped
}
for s.loop.Loop(ctx) {
if j >= c {
break
Expand Down
9 changes: 9 additions & 0 deletions testdata/book/loop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,12 @@ steps:
&& steps[6] != null
&& steps[7] != null
&& steps[8] != null
-
desc: zero loop is skip
req:
/users/k1LoW:
get:
body:
application/json:
null
loop: 0

0 comments on commit bd56419

Please sign in to comment.