Open
Description
Where the server decides to use default include paths, i.e. when the client does not provide any include paths, there seems no way for the client to specify that it does not want any include paths.
I.e. these two requests:
GET /api/posts
GET /api/post?include
both use the default include paths. However, in the second one the client has specified no include paths, so none should be used... i.e. default include paths should only be used if the client has not provided an include query parameter.
This is potentially breaking though (i.e. if there are clients out there doing request with an empty include parameter), so probably needs to be fixed for 2.0.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
jelhan commentedon Aug 29, 2019
This should be considered a bug IMO as it violates JSON:API specification:
lindyhopchris commentedon Aug 29, 2019
Yeah agreed. I'll take another look at it to see if it can be fixed in a
1.x
release...lindyhopchris commentedon Oct 25, 2019
This is not fixable in 1.x because the
neomerx
package uses the default include paths from the schema if the include paths from the encoding parameters are empty. I.e. there is no way for the client to indicate that it wants nothing included.Parsing here:
https://github.com/neomerx/json-api/blob/c911b7494496e79f9de72ee40d6a2b791caaf95b/src/Http/Query/QueryParametersParser.php#L77-L83
And decision as to whether to use the defaults from the schema here:
https://github.com/neomerx/json-api/blob/c911b7494496e79f9de72ee40d6a2b791caaf95b/src/Encoder/Parameters/ParametersAnalyzer.php#L188-L201
Will have to investigate what happens in more recent versions of the neomerx encoder before deciding whether to raise an issue in that package.