Help with configuring my xano endpoint u00220

Options

Hello.

I've been working with bubble and would like to shift some of my work over to Xano. I'm testing a use case that needs a very specific payload returned from an endpoint as below.

{"0":{"type":0,"content":"0","bold":1,"align":1,"format":1}}

I've used a variable to create this and the response from within xano is perfect

However, when I copy the endpoint and run it from my browser it returns

{"\u00220\u0022":{"align":0,"content":"This rocks!","format":0,"type":0,"bold":0}}

Where the u00220 shows up in place of the "0".


Please assist.

Answers

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    The u00220 is the quotation mark. Get rid of the quotation mark to get this to work properly. If you are having problems with Xano treating the 0 as a number instead of a string (and perhaps making an array instead of an object as a result), try applying the to_text filter on the number. That will give it a stronger type hint.

  • enyarick
    enyarick Member
    Options

    Thanks so much @Ray Deck!

    to_text filter doesn't seem to work as it's not able to create a path with a 0 unless it's in quotation marks when setting up. Which means calling the api externally, it brings up the \u0022.

  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    edited April 2023
    Options

    Do you need this object to be named "0" specifically?

  • enyarick
    enyarick Member
    Options

    @Pawel Magdanski Yes. This needs to be named 0.

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    I tried this on my own - and Xano kept fighting me. I was able to get it to work by making the object in a lambda returned it as it as a base64-encoded JSON stringification, and then decoding that string through base64 decode and json decode. So the structure can be made, but with work!