Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is storing the absolute URLs in $refs a good idea? #1295

Closed
jmartinm opened this issue Jul 5, 2016 · 3 comments
Closed

Is storing the absolute URLs in $refs a good idea? #1295

jmartinm opened this issue Jul 5, 2016 · 3 comments

Comments

@jmartinm
Copy link
Contributor

jmartinm commented Jul 5, 2016

At the moment, as far as I can see, both in the database and in ElasticSearch the $refs between records are expressed as absolute URLs. Talking to @david-caro the question came up of how, for example, could one load a dump of production locally and still have it working (if the references are absolute).

I have seen a couple of 'related' issues on Invenio:

inveniosoftware/invenio-records#117
inveniosoftware/invenio-jsonschemas#23

This same problem might happen, for instance, the moment we switch from labs.inspirehep.net to inspirehep.net, what will we do with the $refs?

@jmartinm jmartinm added this to the Enabling APIs milestone Jul 5, 2016
@jmartinm
Copy link
Contributor Author

jmartinm commented Jul 6, 2016

Talking today IRL, it seems indeed it might not be a good idea. We can instead store a relative path and when presenting the record in the API convert into absolute in the serializer.

@jacquerie
Copy link
Contributor

The helper I introduced in #1680 to convert between schemas and pid_types works as well on relative URLs: https://github.com/inspirehep/inspire-next/pull/1680/files#diff-914d1730de5ed34ec6f4a26aee927dfbR53

@jacquerie
Copy link
Contributor

This issue was moved to inspirehep/inspire-dojson#57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants