The execute button does nothing.
So, I noticed that the parameter type for SAPDataBatch is ‘file’ rather than ‘object’ as I have in other POST operations. This must be because I used a JSON structure to generate the import mapping. I created a message definition using the same schema objects and generated a new import mapping from that. Hey presto!, on the swagger page the parameter type is now object and I can execute my request….
Unfortunately, the import mapping creates an empty schema object.
My service operation:
swagger UI page (note: already authenticated!):
Just wanted to share what i’ve just learnt the hard way, in case anyone else ran into something similar:
In my case, we’ve opted to use JSON structure for our import/export mappings instead of Message Definitions because the latter does not currently support specialized entities (there’s an idea posted here in case this is something you’d want too: https://forum.mendix.com/link/ideas/2650)
However, the downside of using JSON structure for the mappings is that the Swagger documentation will be more limited compared to using Message Definitions. In their documentation (JSON Schema for Published REST Operation), they write that “Operations that have an import or export mapping defined on it will generate such a schema, but only for mappings that are based on message definitions.” and also that if the mapping is not based on a message definition, your body parameter will be depicted as a 'file' type.
So this is the current documented behavior rather than a bug, and you will not be able to click on “Execute” on Swagger, because it will not know of your actual model/schema and is expecting a ‘file’ instead of a JSON input to the body parameter.
I noted OP was using JSON structure for mappings too hence seeing the same issues I had. Apologies for the long mouthful, but TL;DR: the Swagger generated from Mendix will only work as expected if you’re using Message definitions for your import/export mapping, instead of JSON structure.
Normaly Swagger UI provides you the parameters as inpput fields which you are able to use. Do you use a message definition for your REST service? Then Swagger UI should provide you more detailed information about your built service..
Maybe you can provide some more information about your implementation to propably have a better undertsanding of your issue.
Did you perhaps miss the authentication pop-up after hitting execute? Happens to me sometimes.. :)
Facing the same issue. can i know how you got this resolved ?