Esempio n. 1
0
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}'
                         })
Esempio n. 2
0
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}'
        },
    )
Esempio n. 3
0
 def schema(self):
     return TypeSchema(type=str)  # TODO a better description of the geojson
Esempio n. 4
0
 def schema(self):
     return TypeSchema(type=str,
                       metadata={
                           'enum': ['arrival', 'departure'],
                           'default': 'departure'
                       })
Esempio n. 5
0
 def schema(self):
     return TypeSchema(type=int, metadata={'minimum': 0})
Esempio n. 6
0
 def schema(self):
     return TypeSchema(type=str, metadata={'format': 'date-time'})
Esempio n. 7
0
class TimeType(CustomSchemaType):
    _schema = TypeSchema(type=str,
                         metadata={
                             'format': 'navitia-time',
                             'pattern': '\d{2}\d{2}\d{2}'
                         })