inveniosoftware / invenio-records-js

Invenio-Records client library for building the web UI.
https://invenio-records-js.readthedocs.io
GNU General Public License v2.0
1 stars 14 forks source link

controllers: adds $schema to payload #23

Closed pamfilos closed 8 years ago

pamfilos commented 8 years ago

Signed-off-by: Pamfilos Fokianos pamfilosf@gmail.com

lnielsen commented 8 years ago

We need to refactor how the JSON payload is provided. E.g. adding $schema will not work for the Zenodo REST API. I think the best is that we can provide a callback which can "massage" the payload before sending it.

@drjova Any ideas for how best to solve it?

lnielsen commented 8 years ago

Additionally, since we're soon to release Zenodo, we probably need two branches (maint/master, master/next), so that we don't block each other.

drjova commented 8 years ago

Superseded by https://github.com/inveniosoftware/invenio-records-js/pull/24/commits/f0c65e254dd2a345c93388b828d98ef9f448c54c you can now add additional data to the payload by using the existing extra-params attribute

<invenio-records
  extra-params='{"headers": {"foo": "bar"}, "data": {"$schema": "foofoo"}}'
>
</invenio-records>

With that fix you it'll work exactly as it is on invenio-search-js any Invenio app can have its own custom data, headers etc. :)

lnielsen commented 8 years ago

@drjova But I think the problem is as well that it's adding the {'metadata': ..} key…..which is needed on zenodo but not analysis preservation

drjova commented 8 years ago

@lnielsen hmm we have it already there https://github.com/inveniosoftware/invenio-records-js/blob/master/src/invenio-records-js/controllers/InvenioRecordsCtrl.js#L187-L189 I'll make it configurable

drjova commented 8 years ago

superseded by https://github.com/inveniosoftware/invenio-records-js/pull/24