Exemplo n.º 1
0
 class TestType(BASE):
     address = defs.Array(item_type=[
         defs.String(20),
         defs.Integer(min_value=1),
         defs.Boolean()
     ])
Exemplo n.º 2
0
 class WrongType(BASE):
     prop = defs.String(min_length=4, default='foo')
Exemplo n.º 3
0
 class WrongType(BASE):
     prop = defs.String(min_length=4, allowed_values=['foo', 'bar'])
Exemplo n.º 4
0
 class TestType(BASE):
     simple = defs.String()
     with_length = defs.String(max_length=10, min_length=5)
     with_pattern = defs.String(pattern='^\\d+$', default='42')
Exemplo n.º 5
0
 class TestType(defs.ArtifactType):
     foo = defs.String(default='Bar', mutable=False)
Exemplo n.º 6
0
 class TestType(BASE):
     prop = defs.String(readonly=True)
     arr = defs.Array(readonly=True)
Exemplo n.º 7
0
        class TestType(BASE):
            activated = defs.Boolean(required=True, default=False)
            name = defs.String(mutable=False)

            def __is_mutable__(self):
                return not self.activated
Exemplo n.º 8
0
 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)})