-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
[REST] Optionally don't include channels when listing things #3324
Comments
I don't think we should do that. Channels are integral parts of the thing and should therefore be reported. It would be interesting to see how much compression can be achieved by openhab/openhab-distro#1460. You can just add the seven lines to the |
I'd like to see that because I often want to check things but am not interested in the channels. |
@spacemanspiff2007 In #3298 (comment) you argue that fetching namespace data only (which is a some bytes only) instead of the full item (which is more on the order of kB) is wrong, because JSON processing is fast and the larger amount of data doesn't matter. Here you argue exactly the opposite. What is the difference? |
It's not a contradiction, even if it looks like one. 😉 This is not for performance reasons but rather a tooling issue. Maybe it makes sense to implement the response reducer in a generic way so it can be simply reused for the other get endpoints ( But tbh. I have no strong opinion on this one because I can always open a 3rd party tool and load the complete response, there. PS: {
"metadata": {
"namespace": {"value": "asdf"}
}
} |
Ohhh, I now see there's a Regarding the more general discussions we've been having about including fields or not, many modern web apps are moving to GraphQL instead of REST, and the client is required to provide a query naming precisely which fields they want. This not only helps responsiveness, but makes it easy to get the minimal bytes across the wire for bandwidth limited scenarios like mobile apps. It's also nice that you're not having to discuss with each individual API which fields to include by default, and which to exclude, etc, etc. But that'd be a pretty massive change, has disadvantages (not as easy to use from all the scripts and integrations users write to interact with openHAB), and probably not even worth discussing in the 4.0 timeframe. |
But what would be the benefit of having more information than we get with "summary=true" but without channels? I fail to the the use-case for that. |
There is none.
GraphQL has some pros but lots of other issues (e.g. it's very hard for newcomers, no swagger, playground is hard) and for local application bandwidth just doesn't matter. But that's stuff for another issue 😉 |
A front-end guy has chased down one of the extra full calls in MainUI to /rest/things (openhab/openhab-webui#1650) and discovered it's to populate a bridge picker. @J-N-K: what are your thoughts on adding a binding= and/or a onlyBridges param? |
It's not necessary IMHO - |
Inspired by #3300, I noticed that my /rest/things endpoint is 2.6MB, because it includes every channel for every thing. For things like the Things list in MainUI, you don't need the channels, so it would be nice if the API allowed optionally excluding channels.
The text was updated successfully, but these errors were encountered: