class DateType(CustomSchemaType): # we do not respect the official swagger datetime format :( _schema = TypeSchema(type=str, metadata={ 'format': 'navitia-date', 'pattern': '\d{4}\d{2}\d{2}' })
class TimeOrDateTimeType(CustomSchemaType): # either a time or a datetime _schema = TypeSchema( type=str, metadata={ 'format': 'navitia-time-or-date-time', 'pattern': '(\d{4}\d{2}\d{2}T)?\d{2}\d{2}\d{2}' }, )
def schema(self): return TypeSchema(type=str) # TODO a better description of the geojson
def schema(self): return TypeSchema(type=str, metadata={ 'enum': ['arrival', 'departure'], 'default': 'departure' })
def schema(self): return TypeSchema(type=int, metadata={'minimum': 0})
def schema(self): return TypeSchema(type=str, metadata={'format': 'date-time'})
class TimeType(CustomSchemaType): _schema = TypeSchema(type=str, metadata={ 'format': 'navitia-time', 'pattern': '\d{2}\d{2}\d{2}' })