Use submissionSchema instead of schema
authorFrank Bessou <frank.bessou@logilab.fr>
Tue, 16 May 2017 15:34:38 +0200
changeset 208 310659809732
parent 207 f2b81d05b3cb
child 209 c15e53a5b67c
Use submissionSchema instead of schema Note: Here we you should use the jsonary link attribute's submissionSchema, which return jsonary schema wrapper. But it would imply using jsonary schema wrapper everywhere. That should be done in a future changeset.
src/services/hypermedia.js
--- a/src/services/hypermedia.js	Mon May 15 16:56:06 2017 +0200
+++ b/src/services/hypermedia.js	Tue May 16 15:34:38 2017 +0200
@@ -47,11 +47,11 @@
 
     getSubmissionSchema(resource) {
         const selfLink = resource.data.getLink('self').rawLink;
-        const schema = selfLink.schema;
-        if (schema.hasOwnProperty('$ref')) {
-            return this.getSchema(schema.$ref);
+        const submissionSchema = selfLink.submissionSchema;
+        if (submissionSchema.hasOwnProperty('$ref')) {
+            return this.getSchema(submissionSchema.$ref);
         } else {
-            return Promise.resolve(schema);
+            return Promise.resolve(submissionSchema);
         }
     }