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

Support empty parameters #8

Open
SamHurne opened this issue Sep 19, 2015 · 4 comments
Open

Support empty parameters #8

SamHurne opened this issue Sep 19, 2015 · 4 comments
Milestone

Comments

@SamHurne
Copy link
Collaborator

[Moved from Codeplex: https://gw2dotnet.codeplex.com/workitem/1342]

The API will soon support empty query parameters. This means that we don't have to check for that case anymore, and just let the API deal with it.

See: arenanet/api-cdi#24

TODO (up for grabs): remove all code that checks for empty parameters

NOTE: the code should still assert that collection types are not null.
For collections, the only change is that a collection argument with Count == 0 is now a valid argument.

@Ruhrpottpatriot
Copy link
Owner

As per arenanet/api-cdi#24 empty parameters now return an error, so we need to watch for that.

@sliekens
Copy link
Collaborator

Right now we handle this case by throwing an ArgumentException when a user passes an empty list to the FindAll(...) method, but I think that letting the API handle input validation is better. All HTTP errors are wrapped in a ServiceException, which is what we want.

@Ruhrpottpatriot
Copy link
Owner

Hm, however that would mean doing an api call for a thing we could validate for ourselves. I'm not agreeing, that we should let the api handle everything. Things that can be done locally should be done locally. Even more from a mobile application point of view.

@sliekens
Copy link
Collaborator

With server validation, if they ever decide that &ids=<empty> is a valid argument then we don't need to change anything on our side to get the benefits. They might decide to change it to return the same results as &ids=all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants