How to test a Published REST Service with the swagger UI.

1
My REST service has a POST operation that accepts a single body parameter.   The generated swagger UI page should allow me to test my service quickly but whenever I enter some JSON in the body parameter, the Execute button fails to call the service. Is this generated page operating correctly? I’ve tested the same operation with the same JSON body parameter in SOAPUI and it works as expected.   Also, does this swagger UI page support passing in XML parameters? the parameter content type dropdown only ever seems to contain the option ‘application/json’.    
asked
5 answers
2

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. 

answered
0

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.

answered
0

Hi Gerrit,

My service operation:

Body parameter:

swagger UI page (note: already authenticated!):

answered
0

Hey… 

Facing the same issue. can i know how you got this resolved ?

answered
-1

Did you perhaps miss the authentication pop-up after hitting execute? Happens to me sometimes.. :)

answered