class TestType(BASE): address = defs.Array(item_type=[ defs.String(20), defs.Integer(min_value=1), defs.Boolean() ])
class WrongType(BASE): prop = defs.String(min_length=4, default='foo')
class WrongType(BASE): prop = defs.String(min_length=4, allowed_values=['foo', 'bar'])
class TestType(BASE): simple = defs.String() with_length = defs.String(max_length=10, min_length=5) with_pattern = defs.String(pattern='^\\d+$', default='42')
class TestType(defs.ArtifactType): foo = defs.String(default='Bar', mutable=False)
class TestType(BASE): prop = defs.String(readonly=True) arr = defs.Array(readonly=True)
class TestType(BASE): activated = defs.Boolean(required=True, default=False) name = defs.String(mutable=False) def __is_mutable__(self): return not self.activated
class TestType(BASE): props = defs.Dict(properties={"foo": defs.String(), "bar": defs.Boolean()}) fixed = defs.Dict(properties={"name": defs.String(min_length=2), "age": defs.Integer(min_value=0, max_value=99)})