From 89b650db220c91333fc334978500c3eac4c0a0b4 Mon Sep 17 00:00:00 2001 From: Erik Potter Date: Tue, 3 Jan 2017 13:46:42 -0600 Subject: [PATCH] Add FILE type constant Add FILE to list of accepted types for parameter --- flex/constants.py | 1 + flex/loading/common/single_header/type.py | 3 ++- flex/loading/common/single_parameter/type.py | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/flex/constants.py b/flex/constants.py index b52a22c..aeb99f1 100644 --- a/flex/constants.py +++ b/flex/constants.py @@ -22,6 +22,7 @@ STRING = 'string' ARRAY = 'array' OBJECT = 'object' +FILE = 'file' PRIMATIVE_TYPES = { '': (type(None),), diff --git a/flex/loading/common/single_header/type.py b/flex/loading/common/single_header/type.py index e843b91..d75abfc 100644 --- a/flex/loading/common/single_header/type.py +++ b/flex/loading/common/single_header/type.py @@ -9,6 +9,7 @@ NUMBER, INTEGER, BOOLEAN, + FILE, ) from flex.decorators import ( skip_if_empty, @@ -18,7 +19,7 @@ generate_object_validator, ) -ALLOWED_TYPES = [STRING, NUMBER, INTEGER, BOOLEAN, ARRAY] +ALLOWED_TYPES = [STRING, NUMBER, INTEGER, BOOLEAN, ARRAY, FILE] type_schema = { 'type': [STRING, ARRAY], diff --git a/flex/loading/common/single_parameter/type.py b/flex/loading/common/single_parameter/type.py index 27eb4b8..fa2471b 100644 --- a/flex/loading/common/single_parameter/type.py +++ b/flex/loading/common/single_parameter/type.py @@ -9,6 +9,7 @@ NUMBER, STRING, ARRAY, + FILE, ) from flex.utils import ( pluralize, @@ -34,6 +35,7 @@ NUMBER, STRING, ARRAY, + FILE, ], } single_type_validators = construct_schema_validators(single_type_schema, {})