Exemplo n.º 1
0
class LinkSchema(serpy.Serializer):
    """This Class is not used as a serializer, but here only to get the schema of a link"""
    id = StrField()
    title = StrField()
    rel = StrField()
    templated = BoolField()
    internal = BoolField()
    type = StrField()
Exemplo n.º 2
0
class SwaggerParamSerializer(serpy.Serializer):
    description = Field()
    location = Field(label='in')
    name = StrField()
    required = Field()
    type = StrField()
    default = StrField()
    enum = Field()
    minimum = Field()
    maximum = Field()
    format = Field()
    collectionFormat = Field(attr='collection_format')
    items = LambdaField(
        method=lambda _, obj: SwaggerParamSerializer(obj.items).data if obj.items else None, display_none=False
    )
Exemplo n.º 3
0
 class MultiLineStringSchema(serpy.Serializer):
     """used not as a serializer, but only for the schema"""
     type = StrField()
     coordinates = jsonschema.Field(schema_metadata={
         'type': 'array',
         'items': point_2D_schema
     })
Exemplo n.º 4
0
    class JsonchemaSupportedType(serpy.Serializer):
        jsonschemaStrField = StrField(required=False)
        jsonschemaBoolField = BoolField(required=True, display_none=True)
        jsonschemaFloatField = FloatField(required=True, display_none=True)
        jsonschemaIntField = IntField()
        jsonschemaField = Field(schema_type=int)
        jsonschemaMethodField = MethodField(schema_type=str)
        lambda_schema = LambdaField(method=lambda **kw: None, schema_type=Custom())
        list_lambda_schema = LambdaField(method=lambda **kw: None,
                                         schema_type=Custom(many=True))

        def get_jsonschemaMethodField(self, obj):
            pass
Exemplo n.º 5
0
class ErrorSerializer(PbNestedSerializer):
    id = EnumField(attr='id', display_none=True)
    message = StrField()
Exemplo n.º 6
0
class FeedPublisherSerializer(PbNestedSerializer):
    id = StrField(display_none=True)
    name = StrField()
    url = StrField()
    license = StrField()
Exemplo n.º 7
0
    class SectionGeoJsonSchema(serpy.Serializer):
        """used not as a serializer, but only for the schema"""

        type = StrField()
        properties = jsonschema.Field(schema_metadata=properties_schema)
        coordinates = jsonschema.Field(schema_metadata=point_2D_schema)
Exemplo n.º 8
0
 class SerpySupportedType(serpy.Serializer):
     serpyStrField = StrField(display_none=True)
     serpyBoolField = BoolField(display_none=True)
     serpyFloatField = FloatField()
     serpyIntField = IntField()
Exemplo n.º 9
0
class ErrorSerializer(PbNestedSerializer):
    id = EnumField(attr='id')
    message = StrField()
Exemplo n.º 10
0
class FeedPublisherSerializer(PbNestedSerializer):
    id = StrField()
    name = StrField()
    url = StrField()
    license = StrField()