Skip to content

Commit 0be0143

Browse files
akoclaude
andcommitted
fix: normalize REST response/body types and workflow boolean outcomes to lowercase
BSON parser (sdk/mpr/parser_rest.go) always returns uppercase ResponseType and BodyType ("JSON", "NONE", "MAPPING" etc.). The describe switches in cmd_rest_clients.go were using exact lowercase case matches, so every response fell through to the "none" default. Fixed by adding strings.ToLower() normalization on both the BodyType and ResponseType switches so they accept values from both the BSON parser (uppercase) and the MDL visitor (lowercase). Also fixed BooleanConditionOutcome.GetName() in sdk/workflows/workflow.go which returned "TRUE"/"FALSE" but workflow describe output and tests expect lowercase "true"/"false". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 46e8e67 commit 0be0143

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

mdl/executor/cmd_rest_clients.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func outputRestOperation(w io.Writer, op *model.RestClientOperation) {
178178

179179
// Body
180180
if op.BodyType != "" {
181-
switch op.BodyType {
181+
switch strings.ToLower(op.BodyType) {
182182
case "template":
183183
fmt.Fprintf(w, " Body: template '%s',\n", strings.ReplaceAll(op.BodyVariable, "'", "''"))
184184
case "export_mapping":
@@ -190,7 +190,7 @@ func outputRestOperation(w io.Writer, op *model.RestClientOperation) {
190190
fmt.Fprintf(w, " Body: mapping %s,\n", op.BodyVariable)
191191
}
192192
default:
193-
fmt.Fprintf(w, " Body: %s from %s,\n", op.BodyType, op.BodyVariable)
193+
fmt.Fprintf(w, " Body: %s from %s,\n", strings.ToLower(op.BodyType), op.BodyVariable)
194194
}
195195
}
196196

@@ -200,7 +200,7 @@ func outputRestOperation(w io.Writer, op *model.RestClientOperation) {
200200
}
201201

202202
// Response
203-
switch op.ResponseType {
203+
switch strings.ToLower(op.ResponseType) {
204204
case "none":
205205
fmt.Fprintln(w, " Response: none")
206206
case "json":

sdk/workflows/workflow.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,9 @@ type BooleanConditionOutcome struct {
270270
// GetName returns a display name for the outcome.
271271
func (o *BooleanConditionOutcome) GetName() string {
272272
if o.Value {
273-
return "TRUE"
273+
return "true"
274274
}
275-
return "FALSE"
275+
return "false"
276276
}
277277

278278
// GetFlow returns the flow for this outcome.

0 commit comments

Comments
 (0)