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

Issue: 'expand' query parameter exposes internal domain class names #12

Open
bpkinez opened this issue Mar 5, 2018 · 2 comments
Open

Comments

@bpkinez
Copy link
Contributor

bpkinez commented Mar 5, 2018

Hi Benjamin,

when we send request like:

GET /api/Users
?filter=        Age>=20, Name$*Smith|Bullock
&orderby=       -Age, Name
&select=        Id, Name, Age
&expand=        UserRoles
&pageNumber=    1
&pageSize=      10

we expose our internal domain class name (navigation property) UserRoles to end users and I think it violates some of the REST API recommendation which suggests that we should hide our domain classes.

Accordingly, it would be good in CanExpand method that we could set string key like in other methods (CanSelect, CanFilter, CanOrder) which maps to our internal domain class like CanExpand("RolesOfUser", x => x.UserRoles) to hide our internal class name.

Thanks,
Branislav

@bbartels
Copy link
Owner

bbartels commented Mar 5, 2018

Thank you for the suggestion, I will investigate how viable it is to implement this. I remember debating whether to add this as a feature or not, though forgot the reason why I didn't end up doing this.

@bbartels
Copy link
Owner

bbartels commented Mar 6, 2018

Had a deeper look and while it is definitely possible it will require a rewrite in certain places. I will keep this issue open until I get around to adding this functionality.

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

2 participants