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? #57

Open
jacquerie opened this issue Aug 14, 2017 · 2 comments
Open

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

jacquerie opened this issue Aug 14, 2017 · 2 comments

Comments

@jacquerie
Copy link
Contributor

From @jmartinm on July 5, 2016 14:50

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?

Copied from original issue: inspirehep/inspire-next#1295

@jacquerie
Copy link
Contributor Author

From @jmartinm on July 6, 2016 12:23

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 Author

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

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

1 participant