You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm trying to push part of the request json payload into the response body. Unfortunately, it doesn't seem to be working. I have tested multiple scenarios and part or the full object is pushed into the response as a String (instead of the json format).
Describe the bug
I'm trying to push part of the request json payload into the response body. Unfortunately, it doesn't seem to be working. I have tested multiple scenarios and part or the full object is pushed into the response as a String (instead of the json format).
To Reproduce
Steps to reproduce the behavior:
Send this payload
{ "supportingService": [ { "isBundle": false, "serviceDate": "2023-09-22T12:02:50.050Z", "supportingResource": [], "@type": "Service", "hasStarted": true, "serviceSpecification": { "@referredType": "ServiceSpecification", "@type": "serviceSpecification", "name": "Points to ETH OVC RFS", "id": "RFS002" }, "description": "ETH OVC Service", "supportingService": [ { "isBundle": false, "serviceDate": "2023-09-22T12:02:50.050Z", "supportingResource": [], "@type": "Service", "hasStarted": true, "serviceSpecification": { "@referredType": "ServiceSpecification", "@type": "serviceSpecification", "name": "Points to ETH ENNI RFS", "id": "RFS003" }, "description": "ETH ENNI RFS", "supportingService": [], "relatedParty": [], "isServiceEnabled": true, "feature": [], "id": "1691445769362", "state": "active", "category": "SATCOM Services", "startDate": "2023-09-22T12:02:50.050Z", "isStateful": true, "serviceCharacteristic": [ { "valueType": "string", "name": "mef-service-type", "id": "0001", "value": "POINT_TO_POINT_CONNECTIVITY" }, { "valueType": "string", "name": "mef-service-level", "id": "0002", "value": "GUARANTEED" }, { "valueType": "long", "name": "rfSvcTemplateId", "id": "0003", "value": 1691445769351 }, { "valueType": "long", "name": "switchId", "id": "0004", "value": 1691524921187 }, { "valueType": "long", "name": "modemId", "id": "0005", "value": 1691445769361 }, { "valueType": "long", "name": "servicePointId", "id": "0006", "value": 1691166338810 }, { "valueType": "long", "name": "CIR", "id": "0007", "value": 4500000 }, { "valueType": "long", "name": "CBS", "id": "0008", "value": 2500000 }, { "valueType": "long", "name": "vlanNumber", "id": "0009", "value": 2102 }, { "valueType": "long", "name": "satId", "id": "00010", "value": 1692975830389 } ] } ], "relatedParty": [], "isServiceEnabled": true, "feature": [], "id": "1691524921186", "state": "active", "category": "SATCOM Services", "startDate": "2023-09-22T12:02:50.050Z", "isStateful": true, "serviceCharacteristic": [ { "valueType": "string", "name": "gatewayName", "id": "0001", "value": "TMF-GW" } ] } ] }
Configure the Body as:
{"serviceSpecification": ${BODY_JSON_PATH(expression="$.supportingService[0].serviceSpecification")} }
Configure the response header: Content-Type: application/json
Use postman to trigger the request
See the error on the response
{ "serviceSpecification": {@referredType=ServiceSpecification, @type=serviceSpecification, name=Points to ETH OVC RFS, id=RFS002 } }
Expected behavior
My expectation is that the body contains a correct json format.
Screenshots
Castle Mock
Latest docker images (castlemock/castlemock)
The text was updated successfully, but these errors were encountered: