Provide support in CoDL schemas for coproducts
There should be a standard way of serializing a coproduct. For example, given,
sealed trait Node
case class File(path: Text) extends Node
case class Directory(path: Text, empty: Boolean) extends Node
we should write these as,
node file
path /path/to/file
node directory
empty yes
path /path/to/directory/
where the parameter, file or directory would have the name type. The children of each should be checked for the particular type.
In a schema, the definitions for node file and node directory should (on some level) be as different as any other two distinct keywords, but consideration needs to be paid to the multiplicity of node... This is currently unresolved.
As a suggestion for how to encode the example above in a schema, we could define:
node type:
node.file path
node.directory path empty
This indicates that the schema for the field node has a parameter called type which is indicated, by the :, to be a coproduct, and that a node which is a file should have a path parameter, while the node which is a directory should have a path and an empty parameter.
node.file and node.directory should behave like schemata for ordinary product types.