def introspect(self): # type: () -> Introspection return strip_none({ 'type': self.introspect_type, 'description': self.description, 'options': [option.introspect() for option in self.options], })
def introspect(self): # type: () -> Introspection return strip_none({ 'type': self.introspect_type, 'description': self.description, # Unfortunately, this is the one sort of thing we can't represent # super well. Maybe add some dotted path stuff in here. 'valid_type': repr(self.valid_type), })
def introspect(self): # type: () -> Introspection return strip_none({ 'type': self.introspect_type, 'description': self.description, 'min_length': self.min_length, 'max_length': self.max_length, 'allow_blank': self.allow_blank and None, # if the default True, hide it from introspection })
def introspect(self): # type: () -> Introspection return strip_none({ 'type': self.introspect_type, 'description': self.description, 'gt': self.gt, 'gte': self.gte, 'lt': self.lt, 'lte': self.lte, })
def introspect(self): # type: () -> Introspection return strip_none({ 'type': self.introspect_type, 'description': self.description, 'value_schema': self.value_schema.introspect() if self.value_schema else None, })
def introspect(self): # type: () -> Introspection return strip_none({ 'type': self.introspect_type, 'description': self.description, 'requirements': [requirement.introspect() for requirement in self.requirements], })
def introspect(self): # type: () -> Introspection return strip_none({ 'type': self.introspect_type, 'description': self.description, 'gt': six.text_type(self.gt) if self.gt else None, 'gte': six.text_type(self.gte) if self.gte else None, 'lt': six.text_type(self.lt) if self.lt else None, 'lte': six.text_type(self.lte) if self.lte else None, })
def introspect(self): # type: () -> Introspection return strip_none({ 'type': self.introspect_type, 'values': [ s if isinstance(s, (six.text_type, bool, int, float, type(None))) else six.text_type(s) for s in sorted(self.values, key=six.text_type) ], 'description': self.description, })
def introspect(self): # type: () -> Introspection return strip_none({ 'type': self.introspect_type, 'description': self.description, 'switch_field': self.switch_field, 'contents_map': { key: value.introspect() for key, value in self.contents_map.items() }, })
def introspect(self): # type: () -> Introspection return strip_none({ 'type': self.introspect_type, 'contents': [value.introspect() for value in self.contents], 'description': self.description, 'additional_validation': (self.additional_validator.__class__.__name__ if self.additional_validator else None), })
def introspect(self): # type: () -> Introspection return strip_none({ 'type': self.introspect_type, 'description': self.description, 'domain_whitelist': (sorted(self.domain_whitelist) if self.domain_whitelist and self.domain_whitelist is not self.__class__.domain_whitelist else None), })
def introspect(self): # type: () -> Introspection return strip_none({ 'type': self.introspect_type, 'description': self.description, 'valid_currencies': ( '(all currencies)' if self.valid_currencies is DEFAULT_CURRENCY_CODES else sorted(self.valid_currencies) ), 'gt': self.gt, 'gte': self.gte, 'lt': self.lt, 'lte': self.lte, })
def introspect(self): # type: () -> Introspection base_classes = None if self.base_classes: if isinstance(self.base_classes, type): base_classes = [six.text_type(self.base_classes)] else: base_classes = [six.text_type(c) for c in self.base_classes] return strip_none({ 'type': self.introspect_type, 'description': self.description, 'base_classes': base_classes, })
def introspect(self): # type: () -> Introspection introspection = { 'type': self.introspect_type, 'contents': self.contents.introspect(), 'max_length': self.max_length, 'min_length': self.min_length, 'description': self.description, 'additional_validation': (self.additional_validator.__class__.__name__ if self.additional_validator else None), } return strip_none(introspection)
def introspect(self): # type: () -> Introspection return strip_none({ 'type': self.introspect_type, 'description': self.description, 'base_class': six.text_type(self.base_class.__name__) if self.base_class else None, 'default_path': self.default_path, 'switch_field': 'path', 'switch_field_schema': self.switch_field_schema.introspect(), 'kwargs_field': 'kwargs', 'kwargs_contents_map': {k: v.introspect() for k, v in six.iteritems(self._schema_cache)}, })
def introspect(self): # type: () -> Introspection result = { 'type': self.introspect_type, 'max_length': self.max_length, 'min_length': self.min_length, 'description': self.description, 'additional_validation': (self.additional_validator.__class__.__name__ if self.additional_validator else None), } # type: Introspection # We avoid using isinstance() here as that would also match subclass instances if not self.key_type.__class__ == Hashable: result['key_type'] = self.key_type.introspect() if not self.value_type.__class__ == Anything: result['value_type'] = self.value_type.introspect() return strip_none(result)
def introspect(self): # type: () -> Introspection display_order = None # type: Optional[ListType[AnyType]] if isinstance(self.contents, OrderedDict): display_order = list(self.contents.keys()) return strip_none({ 'type': self.introspect_type, 'contents': {key: value.introspect() for key, value in self.contents.items()}, 'optional_keys': sorted(self.optional_keys), 'allow_extra_keys': self.allow_extra_keys, 'description': self.description, 'display_order': display_order, 'additional_validation': (self.additional_validator.__class__.__name__ if self.additional_validator else None), })
def introspect(self): # type: () -> Introspection return strip_none({ 'type': self.introspect_type, 'description': self.description, 'validator': self.validator_description, })