Unfortunately currently in the generated swagger only allows sending a string (url) of the image.
It doesn’t generate the spec for sending images as a bases64-encoded string.
So if one wants to do this they have to manually edit the swagger and this leaves room to make mess up the swagger.
So i’m suggesting you provide both options in the swagger or maybe in the settings let a user select which version (url or base64 enconded image) they want the generated swagger to have.
This feature together with returning objects from api workflow (instead of ids) will free users from editing the swagger spec when using bubble as backend for dropsource or any similar platform that may use the swagger.
Please can you be specific with the information or context you require.
I thought my initial post explained exactly what the issue is and the context.
If there is something specific you want to see please let me know
Yes I understand, but I thought my original post clearly states the context.
That is, I want to send an image from dropsource app to my bubble database using a base64-encoded image string .
The swagger generated currently only supports sending an image url.
Thanks
Hey @lottemint.md, yes I’m aware of what you shared. If you read my original post I already referenced this.
The feature request here is for bubble to make the swagger file support this out of the box without the user having to edit the swagger file.
@seanhoots To make sure we understand, are you looking for string format modifier to be exposed in Swagger for your app because defining file as base64 in Bubble is already supported. Here is Swagger documentation.
HI @neerja, please can you show me where in the swagger is this supported.
Again take a look at the swagger snapshot below, I dont see anywhere in the swagger that the following fields are exposed to be able to post a base64 image to bubble
As you can see from the image above the swagger only exposes a string field so you can only post an image url not an image in base64. Unless you manually edit the swagger.
This is what all dropsource users have to do when they want to send an image from their app to bubble .
They have to manually edit bubble’s generated swagger to expose the fields (filename, contents, private, attach_to).
So my request is for bubble to expose these fields so that bubble developers doesn’t have to manually edit the swagger that bubble generates.
So in dropsource when i import this swagger i only see a single string field for an image.
Example in the swagger above this is how it shows up in dropsource. Only the string field that allows posting an image url is shown.
I need to at least see the fields filename and content to be able to post a base64 image.
Unless i manually edit the generated swagger these fields are not exposed.
Hi @neerja,
Looks like you’re not understanding me.
Bubble automatically generates a swagger specification for any bubble app.
Bubbble supports sending an image to the database as url or base64 enconded string.
But in the swagger that bubble generates, only the option to send an image as a url is exposed.
So what i’m asking is to expose the fields that allow sending an image as a base64 string just as you’ve done for the url.
In bubble’s documentation it states that you can post an image as base64 by supplying values for the following fields:
But these fields are not exposed in the swagger file that bubble generates.
The answer to your question above is that this is not a swagger requirement but bubble’s own requirement as stated in bubble’s manual here.
Basically bubble is saying you can send an image using method A or B.
Then bubble generates a file that allows users to send images.
But bubble only expose method A.
And all i’m asking is for bubble to expose method B too.
So this is not a swagger requirement but bubble’s own requirement.
This issue is not perculiar to Dropsource.
Any application that wants to integrate with bubble using Bubble’s own generated swagger will face this issue.
We’ll look into this, but as swagger doesn’t let you specify alerternate ways to send data for the same call, we may need some time to fix this. In the meantime, I recommend sending the file as a URL.
Thanks @emmanuel for responding to this.
I can understand the issue of swagger not supporting alternative parameters.
Maybe one way of getting around this will be to allow users to specify in the settings which option they will want to send their images/files so you base your swagger generation on their choice.