-
Notifications
You must be signed in to change notification settings - Fork 0
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
Query string values that mean "not set yet". #15
Comments
Could we adopt the same approach proposed for greater than/less than cases? Something along the lines of |
Works for me. I'd planned not to include any Null values in my API response, i.e. this:
Rather than this:
Assuming it's fine to omit null properties, and doesn't break any rules of the standards we're sticking to, then perhaps |
Happy to go with
|
Yep good plan. Pop them in a table and whack it in the standards draft, e.g:
What me to make a first stab at this? |
Closing this as discussion of the same matter has now moved to #18. |
Example
Let's say I want to get a list of all my sensors:
GET /sensors
If I want to get all the sensors in a given deployment then I could use:
GET /sensors?inDeployment=public-weather-stations
Now what if I want to get all the sensors that are not in a deployment yet?
Possible solutions:
GET /sensors?inDeployment=false
Downside: You'll have to ban deployments called 'false'. The same would apply if you used
null
instead offalse
.GET /sensors?inDeployment=
Downside: This is ambiguous as to whether it means a) give me all sensors whatever the deployment, or b) gives me sensors not in a deployment.
GET /sensors?assignedToDeployment=false
Downside: You need to document another query string parameter. And probably forbid the presence of
inDeployment
whenassignedToDeployment=false
.The text was updated successfully, but these errors were encountered: