Skip to content

feature request: support discriminated union type #529

@tylim88

Description

@tylim88

currently the library does not support discriminated union, which is a very useful pattern in TS

can we do something like:

		attributes: {
			animal: {
				type: 'discriminated union',
                                 unions:{
                                      fish:{
                                          type:'map',
                                          properties:{
                                                 habitat:{
                                                      type: 'lake'
                                                 }
                                          }
                                      dog:{
                                          type:'map',
                                          properties:{
                                                 habitat:{
                                                      type: 'land'
                                                 }
                                          }
                                     }
                                }
			},
		}

?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions