st2web icon indicating copy to clipboard operation
st2web copied to clipboard

Hints for nested properties in Sensor `payload_schema` (house.dog.fleas)

Open arm4b opened this issue 10 years ago • 4 comments

The cool thing I found (suddenly :facepunch:) is that Sensor payload schema supports description for each property and even more, webui shows the hints! 1 That's just awesome, however never seen someone uses that in any docs or examples.


It will be also nice to show hints for every child property in sensor payload_schema, like house.dog.fleas.

More hints = faster rule creation and better user experience

arm4b avatar Sep 15 '15 23:09 arm4b

Oh, I could find related discussion: https://github.com/StackStorm/st2web/pull/191 Is something like that already implemented?

arm4b avatar Sep 16 '15 00:09 arm4b

Sadly, no. Before the PR you've mentioned, house.dog.flies didn't even validate to begin with, let alone description, so at least we fixed that. :) As far as I know (I'm not sure, so @enykeev can correct me on that), we don't even get data about child properties. So that's not even a web UI issue: we suggest everything that comes via API.

emedvedev avatar Sep 16 '15 02:09 emedvedev

Yes and no. We got all the data we need to suggest\validate the criteria. The problems are a) users rarely add the info for the second level of payload so b) we don't make an additional effort to parse parameters within another type: object. As soon as it will become something people actually need, there's not too much effort required to add it, but now we're spread thin and have to prioritize.

enykeev avatar Sep 16 '15 04:09 enykeev

Yeah, as I checked, data about the nested properties is returned from API. So it's only about st2web implementation.

Majority of data returned from Sensors is structurized and nested this way, 90%+ of Sensors written by us (or by @Kami :) I believe if we'll start documenting all future community Sensors as much as it possible for better autocomplete support in WebUI - better it will be for users and easier to use the product.

At least I'll start documenting new sensors this way from now (where it makes sense), hoping that it will be supported in webui someday.

I agree that such cosmetic change is not a priority, let's keep this feature request opened :zzz:

arm4b avatar Sep 16 '15 10:09 arm4b