Example #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)
Example #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)
Example #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)
Example #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()
Example #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"]
Example #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")
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)
Example #8
0
class SearchAddressPageSchema(OffsetLimitPageSchema):
    list_param = QueryStringList(String())
    enum_param = EnumField(TestEnum)
Example #9
0
class TestSchema(Schema):
    choice = EnumField(Choices)
    value = EnumField(ValueType, by_value=True)
Example #10
0
class EnumQueryStringListSchema(Schema):
    foo_ids = QueryStringList(EnumField(TestEnum))
Example #11
0
class SearchTaskEventSchema(SearchEventSchema):
    task_id = fields.UUID()
    event_type = EnumField(TaskEventType)
Example #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)
Example #13
0
class SearchToppingSchema(PageSchema):
    pizza_id = fields.UUID(required=True, )
    topping_type = EnumField(ToppingType)