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()
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 )
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 })
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
class ErrorSerializer(PbNestedSerializer): id = EnumField(attr='id', display_none=True) message = StrField()
class FeedPublisherSerializer(PbNestedSerializer): id = StrField(display_none=True) name = StrField() url = StrField() license = StrField()
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)
class SerpySupportedType(serpy.Serializer): serpyStrField = StrField(display_none=True) serpyBoolField = BoolField(display_none=True) serpyFloatField = FloatField() serpyIntField = IntField()
class ErrorSerializer(PbNestedSerializer): id = EnumField(attr='id') message = StrField()
class FeedPublisherSerializer(PbNestedSerializer): id = StrField() name = StrField() url = StrField() license = StrField()