Open
Description
Is it possible to add a link to a relationship? So add a link to the firstQuestion
"relationships": {
"questions": {
"links": {
"firstQuestion": "http://localhost/api/v1/questions/616c98f8-3ea9-4bb2-8152-3dd40c3846eb",
"related": "http://localhost/api/v1/surveys/4b732db9-48da-43c9-bec0-6df2dc7dcbe3/questions",
"self": "http://localhost/api/v1/surveys/4b732db9-48da-43c9-bec0-6df2dc7dcbe3/relationships/questions"
}
}
}
I'm not an expert on the spec but reading https://jsonapi.org/format/#document-resource-object-relationships sounds like it should be allowed? We can add extra links to other link objects.
Full example
{
"jsonapi": {
"version": "1.0"
},
"links": {
"self": "http://localhost/api/v1/surveys/4b732db9-48da-43c9-bec0-6df2dc7dcbe3"
},
"data": {
"type": "surveys",
"id": "4b732db9-48da-43c9-bec0-6df2dc7dcbe3",
"attributes": {
"name": "Survey A",
"description": "Description of Survey A"
},
"relationships": {
"questions": {
"links": {
"firstQuestion": "http://localhost/api/v1/questions/616c98f8-3ea9-4bb2-8152-3dd40c3846eb",
"related": "http://localhost/api/v1/surveys/4b732db9-48da-43c9-bec0-6df2dc7dcbe3/questions",
"self": "http://localhost/api/v1/surveys/4b732db9-48da-43c9-bec0-6df2dc7dcbe3/relationships/questions"
}
}
},
"links": {
"self": "http://localhost/api/v1/surveys/4b732db9-48da-43c9-bec0-6df2dc7dcbe3"
}
}
}
Metadata
Metadata
Assignees
Labels
No labels