There's times I want to annotate a function to only take/return the struct, not the array possibility. The definition for the type being tied to it, is annoying.
I'd much rather the places that use it hold the responsibility to do the type or array[struct] definition.
On the other hand, you can make a whole different type for it like StatelessVisualisations.
As I understand how the json format works, this would also optimize its size. While not that important, it's still a positive :]
(though the solution for size would be a special complex type)
Please remove/split struct or array[struct] definitions
Re: Please remove/split struct or array[struct] definitions
After consideration, we decided that we won't change this format. It would indeed be more straightforward to use the type that way, but it'll add a layer of indirection to the JSON/website that'll make it harder to understand and use.
You'll have to restrict the type yourself in code when you need that. Or maybe FMTK could get some sort of support for making this easier? I'm not sure.
You'll have to restrict the type yourself in code when you need that. Or maybe FMTK could get some sort of support for making this easier? I'm not sure.
Re: Please remove/split struct or array[struct] definitions
Or the docs builder could detect and handle the type or array of type case.
Re: Please remove/split struct or array[struct] definitions
You mean the docs builder on our side?
Re: Please remove/split struct or array[struct] definitions
Yes.
edit: Actually, from my cursory search, the docs are full of "type or array of type" cases. It's quite clear and has never caused any difficulty, at least for me. IDK what types the OP means, but they absolutely could (and should) be reworked. And I agree with you that things like StatelessVisualisations are the worst. They should also be changed to "type or array of type" at the place of use. Will make it more consistent.
edit: Actually, from my cursory search, the docs are full of "type or array of type" cases. It's quite clear and has never caused any difficulty, at least for me. IDK what types the OP means, but they absolutely could (and should) be reworked. And I agree with you that things like StatelessVisualisations are the worst. They should also be changed to "type or array of type" at the place of use. Will make it more consistent.
Re: Please remove/split struct or array[struct] definitions
Oh you made me realize I only considered this part of the proposal:
and not this one:On the other hand, you can make a whole different type for it like StatelessVisualisations.
This would be tedious and confusing to do manually on our side, but there are ways to automate it for the best of both worlds. We'll be working on that, and I'll move this back to unresolved until then.I'd much rather the places that use it hold the responsibility to do the type or array[struct] definition.