Test and document REST endpoints faster with a better swagger file - Mendix Forum

Test and document REST endpoints faster with a better swagger file

13

The Swagger file generated by Mendix is improving every release 👊. For more speed of testing and better documentation the example messages and model can be improved.


EXAMPLE MESSAGES (REQUEST AND RESPONSE)
For example: http://petstore.swagger.io/#/store/placeOrder (if you click on try out it will immediately fill in a example message for placing an order.)

I think this can be done in Mendix in the Message Definitions to extend with example values and a documentation column. This will result in multiple message definitions to get this done effectively (a better Name for a definition is also welcome instead of the root element External name):

In swagger the example message can be filled in with these values.

 

DOCUMENTATION

For documentation of the message the model in swagger can be used:
http://petstore.swagger.io/#/pet/updatePet and click on Model. It will show some comments near the attributes requested in the message:

 

Sure above is for a request body but also for a response with httpcode 200. But will be nice 😎 to specify a message definition per response code like a 404, 422 etc.

asked
1 answers

YEAH :D

 

@andrej except the documentation of the error situation 😉

Created