Beispiel #1
0
class Person(Structure):
    _required = ['ssid']
    name = String(pattern='[A-Za-z]+$', maxLength=8)
    ssid = String(minLength=3, pattern='[A-Za-z]+$')
    num = Integer(maximum=30,
                  minimum=10,
                  multiplesOf="dd",
                  exclusiveMaximum=False)
    foo = StructureReference(a=String(),
                             b=StructureReference(c=Number(minimum=10),
                                                  d=Number(maximum=10)))
Beispiel #2
0
class Example(Structure):
    i = Integer(maximum=10)
    s = String(maxLength=5)
    array = Array[Integer(multiplesOf=5), Number]
    embedded = StructureReference(a1=Integer(), a2=Float())
    simplestruct = SimpleStruct
    all = AllOf[Number, Integer]
    enum = Enum(values=[1, 2, 3])
Beispiel #3
0
class Example(Structure):
    anything = Anything
    i = Integer(maximum=10)
    s = String(maxLength=5)
    any = AnyOf[Array[Person], Person]
    complex_allof = AllOf[
        AnyOf[Integer,
              Person], BigPerson]  # this is stupid, but we do it for testing
    people = Array[Person]
    array_of_one_of = Array[OneOf[
        Float, Integer, Person,
        StructureReference(a1=Integer(), a2=Float())]]
    array = Array[Integer(multiplesOf=5), OneOf[Array[Person], Number]]
    embedded = StructureReference(a1=Integer(), a2=Float())
    simplestruct = SimpleStruct
    all = AllOf[Number, Integer]
    enum = Enum(values=[1, 2, 3])
    _required = []
Beispiel #4
0
class Example(Structure):
    i = Integer(maximum=10)
    s = String(maxLength=5)
    a = Array[Integer(multiplesOf=5), Number]
    foo = StructureReference(a1=Integer(), a2=Float())
    ss = SimpleStruct
    all = AllOf[Number, Integer]
    any = AnyOf[Number(minimum=1), Integer]
    one = OneOf[Number(minimum=1), Integer]
    no = NotField(fields=[String])
    enum = Enum(values=[1, 2, 3])
Beispiel #5
0
 class Foo(Structure):
     a = String
     i = Integer
     s = StructureReference(st=String, arr=Array)
Beispiel #6
0
 class Bar(Structure):
     s = StructureReference(a=Integer)