Problem
The SEND REST REQUEST writer (serializeRestOperationCallAction in sdk/mpr/writer_microflow_actions.go:586) emits a Microflows\$RestOperationCallAction that fails Mendix mx check whenever the called operation has parameters or a JSON body. Two distinct errors:
- CE7054 "The parameters for '' have been updated. Please refresh the Send REST Request activity."
- CE7067 "Request '' does not support body entity."
Reproduction
CREATE REST CLIENT MfTest.RC_TestApi
BASE URL 'https://httpbin.org'
AUTHENTICATION NONE
BEGIN
OPERATION PostJsonTemplate
METHOD POST
PATH '/post'
HEADER 'Content-Type' = 'application/json'
PARAMETER \$Name: String
PARAMETER \$Email: String
BODY JSON FROM \$JsonBody
RESPONSE JSON AS \$Result;
END;
CREATE MICROFLOW MfTest.PostJsonViaTemplate (\$Name: String, \$Email: String)
RETURNS String AS \$Result
BEGIN
DECLARE \$JsonBody String = '{\"name\": \"' + \$Name + '\", \"email\": \"' + \$Email + '\"}';
\$Result = SEND REST REQUEST MfTest.RC_TestApi.PostJsonTemplate
BODY \$JsonBody;
RETURN \$Result;
END;
/
After mxcli exec and mx check:
[error] [CE7054] "The parameters for 'PostJsonTemplate' have been updated. Please refresh the Send REST Request activity." at Send REST request activity 'PostJsonTemplate (POST)'
[error] [CE7067] "Request 'PostJsonTemplate' does not support body entity." at Send REST request activity 'PostJsonTemplate (POST)'
Root cause
serializeRestOperationCallAction writes a hard-coded skeleton:
doc = append(doc, bson.E{Key: "ParameterMappings", Value: bson.A{int32(3)}}) // empty
doc = append(doc, bson.E{Key: "QueryParameterMappings", Value: bson.A{int32(3)}}) // empty
// ...
if a.BodyVariable != nil {
bv := bson.D{... "Microflows\$BodyVariable" ...}
doc = append(doc, bson.E{Key: "BodyVariable", Value: bv})
}
Two problems:
-
ParameterMappings is always empty. For an operation with N parameters, the call site must emit N Microflows\$RestOperationParameterMapping entries (or whatever the exact $Type is) binding each operation parameter to a microflow expression. Right now we ignore the operation's Parameters array entirely, so mx check complains the activity is out of date.
-
Microflows\$BodyVariable is the wrong field for Rest\$JsonBody operations. Microflows\$BodyVariable is the entity-mapping body kind (used when the operation has Rest\$ImplicitMappingBody and you pass an entity to be export-mapped). For Rest\$JsonBody, the body string is rendered from the operation's template using variables in the calling microflow's scope — the call site must not set BodyVariable at all. Setting it triggers CE7067.
Suggested fix
In serializeRestOperationCallAction:
- Look up the called operation (the executor already has this — it's resolved during
findRestOperation). Read its Parameters and emit one ParameterMappings entry per operation parameter, binding to the corresponding argument expression from the SEND REST REQUEST AST.
- Inspect the operation's
Body.\$Type:
Rest\$JsonBody / Rest\$StringBody → do not set BodyVariable. The body expression already lives on the operation (as Value), and the calling microflow's variables resolve naturally.
Rest\$ImplicitMappingBody → set Microflows\$BodyVariable as today.
This will likely require threading the resolved operation (or at least its parameter list and body kind) through to the writer.
Context
Discovered while verifying #161 / #162 work and the BODY JSON FROM \$var roundtrip fix in commit 4000f8b. The body roundtrip fix is independent — this issue is purely about the call-site activity serialization.
Problem
The
SEND REST REQUESTwriter (serializeRestOperationCallActioninsdk/mpr/writer_microflow_actions.go:586) emits aMicroflows\$RestOperationCallActionthat fails Mendixmx checkwhenever the called operation has parameters or a JSON body. Two distinct errors:Reproduction
After
mxcli execandmx check:Root cause
serializeRestOperationCallActionwrites a hard-coded skeleton:Two problems:
ParameterMappingsis always empty. For an operation with N parameters, the call site must emit NMicroflows\$RestOperationParameterMappingentries (or whatever the exact $Type is) binding each operation parameter to a microflow expression. Right now we ignore the operation'sParametersarray entirely, somx checkcomplains the activity is out of date.Microflows\$BodyVariableis the wrong field forRest\$JsonBodyoperations.Microflows\$BodyVariableis the entity-mapping body kind (used when the operation hasRest\$ImplicitMappingBodyand you pass an entity to be export-mapped). ForRest\$JsonBody, the body string is rendered from the operation's template using variables in the calling microflow's scope — the call site must not setBodyVariableat all. Setting it triggers CE7067.Suggested fix
In
serializeRestOperationCallAction:findRestOperation). Read itsParametersand emit oneParameterMappingsentry per operation parameter, binding to the corresponding argument expression from theSEND REST REQUESTAST.Body.\$Type:Rest\$JsonBody/Rest\$StringBody→ do not setBodyVariable. The body expression already lives on the operation (asValue), and the calling microflow's variables resolve naturally.Rest\$ImplicitMappingBody→ setMicroflows\$BodyVariableas today.This will likely require threading the resolved operation (or at least its parameter list and body kind) through to the writer.
Context
Discovered while verifying #161 / #162 work and the
BODY JSON FROM \$varroundtrip fix in commit 4000f8b. The body roundtrip fix is independent — this issue is purely about the call-site activity serialization.