=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/service/DefaultLinkService.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/service/DefaultLinkService.java 2015-04-24 06:48:37 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/service/DefaultLinkService.java 2015-04-24 06:56:02 +0000 @@ -145,17 +145,27 @@ { for ( Property property : schema.getProperties() ) { - Schema klassSchema = schemaService.getDynamicSchema( property.getKlass() ); - - if ( property.is( PropertyType.REFERENCE ) ) - { - property.setHref( hrefBase + "/schemas/" + klassSchema.getSingular() ); - - if ( klassSchema.haveApiEndpoint() ) - { - property.setApiEndpoint( hrefBase + klassSchema.getApiEndpoint() ); - } - } + if ( PropertyType.REFERENCE == property.getPropertyType() ) + { + Schema klassSchema = schemaService.getDynamicSchema( property.getKlass() ); + property.setHref( hrefBase + "/schemas/" + klassSchema.getSingular() ); + + if ( klassSchema.haveApiEndpoint() ) + { + property.setApiEndpoint( hrefBase + klassSchema.getApiEndpoint() ); + } + } + else if ( PropertyType.REFERENCE == property.getItemPropertyType() ) + { + Schema klassSchema = schemaService.getDynamicSchema( property.getItemKlass() ); + property.setHref( hrefBase + "/schemas/" + klassSchema.getSingular() ); + + if ( klassSchema.haveApiEndpoint() ) + { + property.setApiEndpoint( hrefBase + klassSchema.getApiEndpoint() ); + } + } + } }