webgme / svelte-jsonschema-form

A Svelte component for generating forms from JSON Schema.
MIT License
32 stars 2 forks source link

Empty root object message #22

Open romancow opened 1 year ago

romancow commented 1 year ago

Would probably be nice to show some sort of message conveying that the root object does not have any properties when this is the case, so people aren't confused by just an empty form. Probably should be configurable (via UI options) so it can be tailored to the specific use case.

brollb commented 1 year ago

This might not be bad but I would lean toward saying that it is out of scope and then leaving it to the rest of the site to present a meaningful message if there isn't a meaningful JSON schema. The tricky thing about taking this on is that there could be a lot of different opinions about look & feel that might be nice to avoid.

romancow commented 1 year ago

My only thought was, with some taxonomies, there is a title, but no properties. So it might be nice to have a way to easily "insert" a message inside the form - between the title and any action buttons. This could easily be customizable by using a slot. It could even just be a generic "message" slot, leaving the consumer the responsibility of testing for emptiness and showing their message.

romancow commented 1 year ago

Also, I'd imagine this is pretty low priority. I just noticed when I hit a taxonomy that was empty, I kept wondering if something was broken, so thought I'd take a note of it.