Remove link dupplication in wrapEntityData
authorFrank Bessou <frank.bessou@logilab.fr>
Fri, 07 Apr 2017 16:39:43 +0200
changeset 93 b3c8e9f42ad3
parent 92 00e2a49e82c5
child 94 8f5072d8e015
Remove link dupplication in wrapEntityData The removed code handled the cas where links were in the same level as a '$ref' property. In this case, the resolution algorithm is removing the links property (which is the correct behavior according to the specs). We don't need this code anymore as the issue has been fixed in the cubicweb-jsonschema code.
src/jsonaryutils.js
--- a/src/jsonaryutils.js	Thu Apr 06 15:27:33 2017 +0200
+++ b/src/jsonaryutils.js	Fri Apr 07 16:39:43 2017 +0200
@@ -3,15 +3,9 @@
 import {PropTypes} from "react";
 
 export function wrapEntityData(entity, schema) {
-
     const wrappedData = Jsonary.create(entity);
     const dataSchema = Jsonary.createSchema(schema);
     wrappedData.addSchema(dataSchema);
-    if (schema.hasOwnProperty("links")) {
-        const linkSchema = {links: schema.links};
-        const linkDataSchema = Jsonary.createSchema(linkSchema);
-        wrappedData.addSchema(linkDataSchema);
-    }
     return wrappedData;
 }