Skip to content

Feat(#406): Allow filter[id] and filter[related.id] #458

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

Merged
merged 3 commits into from
Dec 11, 2018

Conversation

milosloub
Copy link
Contributor

Closes #406

@milosloub
Copy link
Contributor Author

@jaredcnance Concept of this is to register "id" as common attribute, work with this as user need (filter, sort....), but for output is ignored (to not double this property in top level and in attribute level).

My first try was to just expose id, but after that 5 tests were failing -> there are some quite hard dependencies. So I had to hide this and just change two Unit test that asks for attributes from
graph.GetContextEntity(typeof(TestResource));
Id is ignored in DocumentBuilder and those two test don't work with DocumentBuilder, so this is the reason to change Assert.Single to Assert.Contains

Btw - During this implementation I discovered, that DocumentBuilder.GetIncludedEntity() doesn't care about hiding null values as it's described in #454. But I let it be for now.

Copy link
Contributor

@jaredcnance jaredcnance left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks good. One minor comment.

PropertyInfo = prop,
InternalAttributeName = prop.Name
};
attributes.Add(idAttr);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should there be a continue here, after the id property is added?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right. Now it's already there.

@milosloub milosloub merged commit c633c71 into json-api-dotnet:master Dec 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants