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

JSON Payload interpreted incorrectly when using post #2801

Open
kanso-git opened this issue May 30, 2024 · 1 comment
Open

JSON Payload interpreted incorrectly when using post #2801

kanso-git opened this issue May 30, 2024 · 1 comment

Comments

@kanso-git
Copy link

kanso-git commented May 30, 2024

I've noticed that the JSON payload gets deformed, especially when there is a dot in a JSON key.

Version info: ^2.0.12

I expected this JSON payload to be sent:

{
   "title":"Customer Operations Agent",
   "body":"Product",
   "userId":1,
   "metadata":{
      "eperson.firstname":[
         {
            "value":"Raul"
         }
      ],
      "eperson.lastname":[
         {
            "value":"Pfannerstill"
         }
      ]
   }
}

When I called my post with the below json payload

      - post:
          url: '/posts'
          json:
             title: '{{title}}'
             body: '{{body}}'
             userId: '{{userId}}'
             metadata:
                 "eperson.firstname":
                    - value: '{{firstName}}'
                 "eperson.lastname":
                    - value: '{{lastName}}'

However, the keys "eperson.firstname" and "eperson.lastname" were interpreted incorrectly and thus transformed to the below

{
   "title":"Customer Operations Agent",
   "body":"Product",
   "userId":1,
   "metadata":{
      "eperson.firstname":[
         {
            "value":"Raul"
         }
      ],
      "eperson.lastname":[
         {
            "value":"Pfannerstill"
         }
      ],
      "eperson":{
         "firstname":[
            {
               "value":"Raul"
            }
         ],
         "lastname":[
            {
               "value":"Pfannerstill"
            }
         ]
      }
   }
}
@kanso-git
Copy link
Author

same case : #879

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