Closed luongvo closed 2 years ago
@luongvo It seems this is not a bug. The resource object might contain relationships
field, but there is no documentation that requires we have to add included
field when there is an existing relationships
field.
But as we don't use the question information when requesting a survey list, so I think we can omit the relationships
field.
Will create a PR for that 🙏
Issue
Currently, the "Survey list" API
GET v1/surveys
focuses on returning the list of survey info without containing the details about the question or answer data. However it's returning the question id list in relationship of thesurvey
object without theincluded
part.This violates the JSON:API format and causes some unexpected issues when parsing this question relationship in client side.
Expected
We have another API
GET v1/surveys/{survey_id}
to return the fullquestion
andanswer
relationships, soGET v1/surveys
should not return the above question id list relationship.Steps to reproduce
GET v1/surveys
API to see the response https://nimblehq.postman.co/workspace/Nimble~9daf6b25-882e-4ad0-8299-95529e2883ff/request/11835486-064357a5-4625-4ef7-b042-0d1f7e2f2acb