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

When fetching relations, there's no meta data attached. #425

Open
jianglibo opened this issue May 11, 2017 · 1 comment
Open

When fetching relations, there's no meta data attached. #425

jianglibo opened this issue May 11, 2017 · 1 comment

Comments

@jianglibo
Copy link

jianglibo commented May 11, 2017

Katharsis doesn't return meta info when fetching relations. I'm not sure whether it follows the jsonapi spec. for example:

/articles/1/comments

If there were thousands of comments for that article, should I return them all? or be paged? I just count this problem today.

@jianglibo
Copy link
Author

jianglibo commented May 11, 2017

look into the code, this is where links and meta be discarded:

	@Override
	public ResourceList<D> findManyTargets(I sourceId, String fieldName, QuerySpec querySpec) {
		MultivaluedMap<I, D> map = findTargets(Arrays.asList(sourceId), fieldName, querySpec);
		if (map.isEmpty()) {
			return new DefaultResourceList<>();
		}
		return (ResourceList<D>) map.getList(sourceId);
	}

This method always call "findTargets" with one unique sourceId, why does it need filter out mata information from it? /sections/1/articles, this kind of relationship is very common. without the mata information, it need to construct the url manually. like /articles?filter[section]=1

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

1 participant