# Adding new REST URL: Unable to getRepresentationDescription for a Class object I created

**URL:** <https://talk.openmrs.org/t/adding-new-rest-url-unable-to-getrepresentationdescription-for-a-class-object-i-created/33261>\
**Category:** Development\
**Tags:** development, api, developers, developers-forum\
**Created:** [April 26, 2021, 12:55pm UTC](https://talk.openmrs.org/t/adding-new-rest-url-unable-to-getrepresentationdescription-for-a-class-object-i-created/33261 "2021-04-26T12:55:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anatoleabe](https://talk.openmrs.org/letter_avatar/anatoleabe/32/5_5575768a8748004e209b776fc1b2916d.png) [@anatoleabe](https://talk.openmrs.org/u/anatoleabe)\
**Post date:** [April 26, 2021, 12:55pm UTC](https://talk.openmrs.org/t/adding-new-rest-url-unable-to-getrepresentationdescription-for-a-class-object-i-created/33261/1 "2021-04-26T12:55:33Z")

</div>

Hello everyone, I am developing a restful API that deserves some services to a front end module using OpenMRS rest API. For example, I have two Classes [Region](https://github.com/savicsorg/openmrs-module-savicsgmao/blob/master/api/src/main/java/org/openmrs/module/savicsgmao/api/entity/District.java) and [District](https://github.com/savicsorg/openmrs-module-savicsgmao/blob/master/api/src/main/java/org/openmrs/module/savicsgmao/api/entity/District.java), where one class (District) contains an attribute linked to the other. When attempting to get the list of District using rest API, I got this [error](https://pastebin.com/rB5trkhG). Here is the [RequestResource](https://github.com/savicsorg/openmrs-module-savicsgmao/blob/master/omod/src/main/java/org/openmrs/module/savicsgmao/web/resource/DistrictRequestResource.java) of my classes.

Please could some one can help on this?. Thanks

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [April 26, 2021, 7:52pm UTC](https://talk.openmrs.org/t/adding-new-rest-url-unable-to-getrepresentationdescription-for-a-class-object-i-created/33261/2 "2021-04-26T19:52:31Z")

</div>

Did you fix this? I see a commit with message: `Fixing issued linked with Representative description. now working`

---

<div class="post-metadata">

**Author:** ![mozzy](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mozzy/32/11815_2.png) [@mozzy](https://talk.openmrs.org/u/mozzy)\
**Post date:** [April 27, 2021, 8:30am UTC](https://talk.openmrs.org/t/adding-new-rest-url-unable-to-getrepresentationdescription-for-a-class-object-i-created/33261/3 "2021-04-27T08:30:34Z")

</div>

you would create Resources for both the entity data models and then [this property](https://github.com/savicsorg/openmrs-module-savicsgmao/blob/master/omod/src/main/java/org/openmrs/module/savicsgmao/web/resource/DistrictRequestResource.java#L44) would reference the resource Representation of the other **Region Resource**

like

`description.addProperty("region" , Representation.DEFAULT);`

instead of

`description.addProperty("region");`

the latter applies to a primitive data types not an entity model
