Exemple #1
0
 class TestType(BASE):
     address = defs.Array(item_type=[
         defs.String(20),
         defs.Integer(min_value=1),
         defs.Boolean()
     ])
Exemple #2
0
 class WrongType(BASE):
     prop = defs.String(min_length=4, default='foo')
Exemple #3
0
 class WrongType(BASE):
     prop = defs.String(min_length=4, allowed_values=['foo', 'bar'])
Exemple #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')
Exemple #5
0
 class TestType(defs.ArtifactType):
     foo = defs.String(default='Bar', mutable=False)
Exemple #6
0
 class TestType(BASE):
     prop = defs.String(readonly=True)
     arr = defs.Array(readonly=True)
Exemple #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
Exemple #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)})