REST API - example payload

Hi ,

Using REST API designer tool to generate API specifications, the structure and paths looks correct, however there is no way to define example values for class attributes.

Is there any property in attribute specification , which can be used as an example property of swagger
external_id : string
example: 684365684_2020

Looking forward for any alternates to generate example values rather hand crafting in request and response body .

Thanks
Venkat

1 Like

Thank you for your inquiry. Do you mean to have the example in REST Service auto generate according to the details defined in its associated request/response classes?

Yes. As we can define classes and attributes, if there is a place to store example for each attribute and then the REST API can use them to create an example payload will be very useful.

1 Like

We are also facing the same problem where we need to add ISO 8601 duration example for class attribute so swagger could generate proper example and won’t show Java duration class as example value but there is no way to do it in Visual Paradigm at the moment.

Thank for your message. Currently we allow user to define example directly on REST class (Request/Response Body > Example Body), but it is not directly linked to the attributes of the request/response classes. We will consider to support link them up in our future release. Feel free to contact me for any questions and wish you have a good day!

2 Likes