Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pushing request json payload into the response body is failing #671

Open
luisfilsilva opened this issue Sep 25, 2023 · 0 comments
Open

Pushing request json payload into the response body is failing #671

luisfilsilva opened this issue Sep 25, 2023 · 0 comments

Comments

@luisfilsilva
Copy link

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:

  1. 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" } ] } ] }

  2. Configure the Body as:
    {"serviceSpecification": ${BODY_JSON_PATH(expression="$.supportingService[0].serviceSpecification")} }

  3. Configure the response header: Content-Type: application/json

  4. Use postman to trigger the request

  5. 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
image

Castle Mock
Latest docker images (castlemock/castlemock)

  • Java: openjdk 21-ea 2023-09-19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant