The signature is an escaped string rather then an array, so I need to slice the string to get the single entries instead of simply calling an array loop. It would make sense to me, if the signature would be stored already in an iteratable way:
The signature is a valid FSL type definition. We document FSL for customers to use and Fauna knows how to parse it. Parsing FSL remains an implementation detail which can (and does) evolve as features are added and updated. Changing the signature property to a walkable AST structure would mean we’d have to stabilize and document an additional API. Whereas, field definitions using FSL can safely be stabilized shortly with GA of schema enforcement and migrations.
Here is a very contrived example, but the point is that types can be arbitrary, and complex. Handling any type AST would very likely not be “simply calling an array loop”.
When you create your own objects, they are no longer Document types, so no, you cannot construct the proposed object and also be tagged as @doc. But I see no reason why you could not otherwise create such an object.
Here’s an example, though I’m not trying here to detect and process any union or intersection types.