FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
115 stars 19 forks source link

When encoding a JSON variable in the BODY of an API (POST) CALL there is a mistake with extras "" #3686

Closed AirtonLucianoAragao closed 1 week ago

AirtonLucianoAragao commented 2 weeks ago

Can we access your project?

Current Behavior

When encoding a JSON variable in the BODY of an API (POST) CALL there is a mistake with extras ""

Expected Behavior

I expect a valid JSON encoding

Steps to Reproduce

  1. Define an API CALL type POST
  2. SET an variable as JSON TYPE and LIST = TRUE
  3. Go to Response & Test tab
  4. Insert a list of JSON objects inside [] like [{"b":"AA"},{"b":"CC"}]
  5. See BODY formated as "["{b: AA}","{b: CC}"]"

Reproducible from Blank

Bug Report Code (Required)

IT4oz+fl4ot2xNtJ7qqNc8JViSQUH1t+U5EnkcpOGDsdF4iuPOxzaeLCTFFvcMe6TWw2KEWGgmIEwPDqvvPTKsBdHxedR4hfyMxTWDnxfz6/aovXCs+sZHdtN95jN0yv06urgBJTBLZqLl472U2YNvCQQj3rN5f4Zwh9f6PHaOI=

Visual documentation

Captura de tela de 2024-08-25 15-51-39 Captura de tela de 2024-08-25 15-52-18 Captura de tela de 2024-08-25 15-52-37

Environment

- FlutterFlow version: Latest
- Platform: Ubuntu
- Browser name and version: Crhome
- Operating system and version affected:

Additional Information

No response

AirtonLucianoAragao commented 2 weeks ago

Now I noticed that the problem is that FF doesn't insert the \ (escape slash) in order to properly configurate the JSON provided by our code (or directly, when testing the API).

Alezanello commented 2 weeks ago

Hello!!

I Couldn't replicate your issue, is sending perfectly in the test i made:

image.png


This is the public URL of the project if you want to see the setup.
https://app.flutterflow.io/project/qa-1814-e5fh83

AirtonLucianoAragao commented 2 weeks ago

Hi Alezanello.

Looking to your project I noticed that at my BODY in CALL DEFINITION there were quotes surrounding the JSON variable and this is not true at your definition. This occured maybe because I changed this variable from STRING to JSON.

Thanks a lot and sorry for my mistake. Captura de tela de 2024-08-27 14-24-38

Alezanello commented 1 week ago

I’m glad everything is working as expected now! I’ll go ahead and close this issue, but if you encounter anything else, please don’t hesitate to open a new one!