Return Data from API action returns a Thing's id instead of the Thing itself

When you use a Return data from API action in an api workflow and define the parameter to return a type, bubble returns only the id of the thing instead of the thing (object).

This is evident if you look at the swagger specification generated by bubble for any api workflow returning a thing (list of things).
In the 200 response example below, the return type is a string instead of a Thing.

Here is how the api workflow was defined. As you can see its supposed to return a list of products.

So when you call this endpoint instead of returning a list of products objects, it will return a list of product ids.

The correct swagger specification should be

In the above instead of returning a string (as it currently does, the bug) i’ve specified that it should return a product.

A lot of uses of dropsource using bubble as backend always have to manually edit the swagger to make this change.
It will be helpful if this can be fix so we just upload the swagger without having to make manual edits anytime a change is made.
FYI @emmanuel and @neerja i’ve filing a bug report for this.

1 Like

@seanhoots Return data from API should return the entire object with a simple data source. Please email Support an example if it’s not working as expected in a test app.

Hi @neerja, yes it should and it does if you call the endpoint directly.
The bug is actually with the generated swagger as i’ve explained above.
As you can see from the swagger definition, Return data from API is defined to return a string.
So for systems that use the swagger like Dropsource, it will always return only the id of the object.
Unless you manually edit the swagger to return a reference as i’ve explained above.

So there is not problem from how bubble handles the endpoint, the problem is just how the swagger has been defined ( i think)

Hi @neerja,
Here is a snapshot i just took from my dropsource project, as you can see below because the swagger specify the endpoint as returning a string, in dropsource you only have access to the id


Whereas if i edit the swagger to a reference instead of string it makes the whole object available as follows:

@seanhoots Confirmed with our engineering team and this behavior is by design. We will support showing object as type rather than string in swagger once we support nested objects which is on our roadmap.

This topic was automatically closed after 14 days. New replies are no longer allowed.