What are the standards for boolean parameters in REST which indicates whether or not certain parts of the response should be included. Should they be prefixed with "include" "with" or similar prefix?
Example:
Say, I have a REST service GET /buildings which returns buildings:
[
{
name: "The Empire State Building",
flors: 102
}
]
Now when there is a use case to include the address, but the address is not always needed (because let's say getting address is quite expensive in the backend, so it is better not to include that by default).
I would like to add parameter which instructs the backend to include address in response, say:
GET /buildings?address=true:
[
{
"name": "The Empire State Building",
"flors": 102,
"address": {
"street" : "Fifth Avenue",
"number": 99
}
}
]
Now the question is how this address parameter should be named: "includeAddress=true", "address=true"or what should be the name?