Fix usage of in JSON from queries to determine embedded element type
@@ -91,7 +91,8 @@ public class OJson extends SimpleNode {
*/
public Object toObjectDetermineType(OResult source, OCommandContext ctx){
String className = getClassNameForDocument(ctx);
- if (className != null){
+ Object type = source == null ? null : source.getProperty("@type");
+ if (className != null || (type != null && "d".equalsIgnoreCase(String.valueOf(type)))) {
return toDocument(source, ctx, className);
}
else{
