From 9f8c6b3a2996abc36b954f4420cd56dcf61147f0 Mon Sep 17 00:00:00 2001 From: ThinkPad Date: Sun, 16 Jul 2017 17:49:22 +0100 Subject: [PATCH] Representation option after create or update object using rest API. RESTWS-669 --- .../rest/web/resource/impl/DelegatingCrudResource.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/omod-common/src/main/java/org/openmrs/module/webservices/rest/web/resource/impl/DelegatingCrudResource.java b/omod-common/src/main/java/org/openmrs/module/webservices/rest/web/resource/impl/DelegatingCrudResource.java index de01c6599..19f153a2b 100644 --- a/omod-common/src/main/java/org/openmrs/module/webservices/rest/web/resource/impl/DelegatingCrudResource.java +++ b/omod-common/src/main/java/org/openmrs/module/webservices/rest/web/resource/impl/DelegatingCrudResource.java @@ -76,7 +76,7 @@ public Object create(SimpleObject propertiesToCreate, RequestContext context) th T delegate = convert(propertiesToCreate); ValidateUtil.validate(delegate); delegate = save(delegate); - SimpleObject ret = (SimpleObject) ConversionUtil.convertToRepresentation(delegate, Representation.DEFAULT); + SimpleObject ret = (SimpleObject) ConversionUtil.convertToRepresentation(delegate, context.getRepresentation()); // add the 'type' discriminator if we support subclasses if (hasTypesDefined()) { @@ -141,7 +141,7 @@ public Object update(String uuid, SimpleObject propertiesToUpdate, RequestContex ValidateUtil.validate(delegate); delegate = save(delegate); - SimpleObject ret = (SimpleObject) ConversionUtil.convertToRepresentation(delegate, Representation.DEFAULT); + SimpleObject ret = (SimpleObject) ConversionUtil.convertToRepresentation(delegate, context.getRepresentation()); // add the 'type' discriminator if we support subclasses if (hasTypesDefined()) {