Ejemplo n.º 1
0
class TestSchema(Schema):
    id = fields.UUID()
    foo = fields.String(description="Foo", default="bar")
    choice = EnumField(Choices)
    value = EnumField(ValueType, by_value=True)
    names = fields.List(fields.String)
    payload = fields.Dict()
    ref = fields.Nested(NewPersonSchema)
Ejemplo n.º 2
0
class SearchCustomerEventSchema(SearchEventSchema):
    event_type = EnumField(
        CustomerEventType,
    )
    pizza_id = fields.UUID()
    order_id = fields.UUID()

    pizza_size = EnumField(PizzaSize)
    pizza_type = EnumField(PizzaType)
    topping_type = EnumField(ToppingType)
Ejemplo n.º 3
0
class NewCustomerEventSchema(Schema):
    event_type = EnumField(
        CustomerEventType,
        required=True,
    )
    pizza_id = fields.UUID()
    order_id = fields.UUID()

    pizza_size = EnumField(PizzaSize)
    pizza_type = EnumField(PizzaType)
    topping_type = EnumField(ToppingType)
Ejemplo n.º 4
0
class TestSchema(Schema):
    id = fields.UUID()
    foo = fields.String(description="Foo", default="bar")
    choice = EnumField(Choices)
    value = EnumField(ValueType, by_value=True)
    names = fields.List(fields.String)
    payload = fields.Dict()
    ref = fields.Nested(NewPersonSchema)
    decimal = fields.Decimal()
    decimalString = fields.Decimal(as_string=True)
    decorated = swagger_field(fields.Method())
    datetime = fields.DateTime()
    unix_timestamp = TimestampField()
    iso_timestamp = TimestampField(use_isoformat=True)
    mixed = MixedField()
Ejemplo n.º 5
0
class NewPersonSchema(Schema):
    # both attribute and data_key fields should result in the same swagger definition
    firstName = fields.String(attribute="first_name", required=True)
    last_name = fields.String(data_key="lastName", required=True)
    eye_color = EnumField(EyeColor, data_key="eyeColor")
    email = fields.Email()

    @property
    def csv_column_order(self):
        return ["firstName", "lastName"]
Ejemplo n.º 6
0
class NewOrderEventSchema(Schema):
    # TODO Restore when migration fixed
    # customer_id = fields.UUID(required=True, data_key='customerId')
    order_id = fields.UUID(required=True, data_key="orderId")
    event_type = EnumField(OrderEventType, required=True, data_key="eventType")
Ejemplo n.º 7
0
class EnumSchema(Schema):
    name = EnumField(TestEnum, by_value=False)
    value = EnumField(TestEnum, by_value=True)
    int_name = EnumField(TestIntEnum, by_value=False)
    int_value = EnumField(TestIntEnum, by_value=True)
Ejemplo n.º 8
0
class SearchAddressPageSchema(OffsetLimitPageSchema):
    list_param = QueryStringList(String())
    enum_param = EnumField(TestEnum)
Ejemplo n.º 9
0
class TestSchema(Schema):
    choice = EnumField(Choices)
    value = EnumField(ValueType, by_value=True)
Ejemplo n.º 10
0
class EnumQueryStringListSchema(Schema):
    foo_ids = QueryStringList(EnumField(TestEnum))
Ejemplo n.º 11
0
class SearchTaskEventSchema(SearchEventSchema):
    task_id = fields.UUID()
    event_type = EnumField(TaskEventType)
Ejemplo n.º 12
0
class NewTaskEventSchema(Schema):
    assignee = fields.String(required=False, allow_none=True)
    deadline = fields.DateTime(required=False, allow_none=True)
    taskId = fields.UUID(attribute="task_id", required=True)
    eventType = EnumField(TaskEventType, attribute="event_type", required=True)
Ejemplo n.º 13
0
class SearchToppingSchema(PageSchema):
    pizza_id = fields.UUID(required=True, )
    topping_type = EnumField(ToppingType)