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

links with absolute URLs cause exceptions #79

Open
joshco opened this issue Feb 20, 2016 · 6 comments
Open

links with absolute URLs cause exceptions #79

joshco opened this issue Feb 20, 2016 · 6 comments

Comments

@joshco
Copy link
Contributor

joshco commented Feb 20, 2016

Getting Chrome error:

Uncaught Error: URNs do not have any generally defined hierarchical components

hal.js:27   var norm = uri.absoluteTo(cur);

When retrieving my API entry point:

{
  "motd": "Welcome to the API Endpoint!",
  "_links": {
    "osdi:people": {
      "href": "http://demo.osdi.io/api/v1/people",
      "title": "The collection of people in the system"
    },
   .....
}
@joshco
Copy link
Contributor Author

joshco commented Feb 20, 2016

hmm. maybe this is a curie problem...

@joshco
Copy link
Contributor Author

joshco commented Feb 20, 2016

More info, looks like it is the curies, or more specifically the key names being seen as URNs, ie 'osdi:people'.
When no curie definition is present, then the hal browser will suffer a js exception and fail to render the page.
In my local branch, for now I'm try/catching that method call and writing a note to console if it can't normalize a rel.

https://github.com/opensupporter/hal-browser/blob/93884b7a9d8d81ee6c41c9d65a254e64289b7fa7/js/hal.js#L28-L33

I propose (beg?) that HAL browser be more liberal in what it accepts. Many people will use HAL browser as they are learning how to build a HAL API, and if it is too strict, they will never be able to figure out how to emit a valid document.

@drdamour
Copy link

👍

2fde261#diff-e684a8343f8a30c1d37d8bc45f73423a intro'd it, and i think it was a regression

@drdamour
Copy link

same as #62

@billyyarosh
Copy link
Contributor

Believe PR #81 will fix this.

@drdamour
Copy link

i can confirm PR 81 fixed this

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

No branches or pull requests

3 participants