The API connector has this annoying quirk.
Any response values that contain a single JSON object can only be matched to a text type instead of a JSON object. This makes it a little annoying to deal with. Easy to parse on the frontend but annoying when dealing with these kind of things server-side.
What I realized is that if that JSON object was returned as part of a JSON array, it is detected as a JSON object. Which I can then match individual values of the object to datatypes and access it as part of a list in that array.
There are workarounds like passing payloads through custom events to parse JSON objects.
For my use case the workaround is to make sure that the single JSON object is stored in a JSON array. Of course, the catch is that you must have control of the payload response. Using a CF worker as middleware can enable this.
I’m posting this as a note to myself but hope it helps others. Feel free to ask questions or share your thoughts.