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

Self Link wrong when opening a related entity? #12

Closed
jhiemer opened this issue May 22, 2012 · 4 comments
Closed

Self Link wrong when opening a related entity? #12

jhiemer opened this issue May 22, 2012 · 4 comments

Comments

@jhiemer
Copy link

jhiemer commented May 22, 2012

Hi,
I am not sure if this is a bug, or me having a misunderstanding. When I open up an entity and the according relation then the ouput looks like this:

{
"startDate": 1337687944636,
"sequence": 0,
"_links": [
{
"rel": "entities.Entity.relation",
"href": "http://localhost:8080/rest/relation"
},
{
"rel": "self",
"href": "http://localhost:8080/rest/relation/3839196d-6c95-494b-a405-e6d9f120b252"
}
],
"endDate": 1337687944636,
"type": 0
}

Self links to the parent entity but not the opened entity itself. The according link to that looks like this:
http://localhost:8080/rest/relation/3839196d-6c95-494b-a405-e6d9f120b252/entity/45c7ad65-09e6-45e4-a549-eda11f4f70b4

What I am doing wrong?

@jbrisbin
Copy link
Contributor

Not sure I understand what you're after. "self" doesn't refer to a specific element of a relation, only a top-level entity.

@jhiemer
Copy link
Author

jhiemer commented May 22, 2012

Hi,
let me give an example:
I am calling the entity Car. Then I get the related Tires of the Car, which results in a list of Tires. Having the list of Tires I pick one tire with the following URL:

http://localhost:8080/rest/Car/3839196d-6c95-494b-a405-e6d9f120b252/Tire/45c7ad65-09e6-45e4-a549-eda11f4f70b4

And it returns me the following:

{
"pressure": 10,
"_links": [
{
"rel": "tires.Tire.car",
"href": "http://localhost:8080/rest/car"
},
{
"rel": "self",
"href": "http://localhost:8080/rest/car/3839196d-6c95-494b-a405-e6d9f120b252"
}
],
"type": 0
}

For self I though it should return

"rel" : "self":
"href": "http://localhost:8080/rest/tire/45c7ad65-09e6-45e4-a549-eda11f4f70b4"

Now more understandable?

jbrisbin added a commit that referenced this issue May 22, 2012
@jbrisbin
Copy link
Contributor

I see what you're saying. I pushed a change to pass the correct information to the link generator. Snapshot artifacts should be available in a few minutes, when the CI build completes.

Thanks for letting me know! :)

@jhiemer
Copy link
Author

jhiemer commented May 22, 2012

Jon,
thanks! Works perfectly!

@jhiemer jhiemer closed this as completed May 22, 2012
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

2 participants