# REST API - example payload

**URL:** <https://forums.visual-paradigm.com/t/rest-api-example-payload/17706>\
**Category:** UML\
**Created:** [September 27, 2022, 10:22pm UTC](https://forums.visual-paradigm.com/t/rest-api-example-payload/17706 "2022-09-27T22:22:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![venkatesh.boya](https://avatars.discourse-cdn.com/v2/letter/v/a698b9/32.png) [@venkatesh.boya](https://forums.visual-paradigm.com/u/venkatesh.boya)\
**Post date:** [September 27, 2022, 10:22pm UTC](https://forums.visual-paradigm.com/t/rest-api-example-payload/17706/1 "2022-09-27T22:22:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rain](https://forums.visual-paradigm.com/user_avatar/forums.visual-paradigm.com/rain/32/2309_2.png) [@Rain](https://forums.visual-paradigm.com/u/Rain)\
**Post date:** [September 29, 2022, 8:00am UTC](https://forums.visual-paradigm.com/t/rest-api-example-payload/17706/2 "2022-09-29T08:00:49Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![venkatesh.boya](https://avatars.discourse-cdn.com/v2/letter/v/a698b9/32.png) [@venkatesh.boya](https://forums.visual-paradigm.com/u/venkatesh.boya)\
**Post date:** [October 6, 2022, 11:12pm UTC](https://forums.visual-paradigm.com/t/rest-api-example-payload/17706/3 "2022-10-06T23:12:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kev](https://forums.visual-paradigm.com/user_avatar/forums.visual-paradigm.com/kev/32/6070_2.png) [@Kev](https://forums.visual-paradigm.com/u/Kev)\
**Post date:** [November 11, 2022, 7:59am UTC](https://forums.visual-paradigm.com/t/rest-api-example-payload/17706/4 "2022-11-11T07:59:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Rain](https://forums.visual-paradigm.com/user_avatar/forums.visual-paradigm.com/rain/32/2309_2.png) [@Rain](https://forums.visual-paradigm.com/u/Rain)\
**Post date:** [November 14, 2022, 4:08am UTC](https://forums.visual-paradigm.com/t/rest-api-example-payload/17706/5 "2022-11-14T04:08:02Z")

</div>

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!
