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