Dump the validators as json inside the _options dictionary with the key `validators`.
342513
def __dump_validators(self):
        """"""
        if hasattr(self, '_validators'):
            validators_json = []
            for validator in self._validators:
                if isinstance(validator, PropertyValidator):
                    validators_json.append(validator.as_json())
                else:
                    raise APIError("validator is not a PropertyValidator: '{}'".format(validator))
            if self._options.get('validators', list()) == validators_json:
                # no change
                pass
            else:
                new_options = self._options.copy()  # make a copy
                new_options.update({'validators': validators_json})
                validate(new_options, options_json_schema)
                self._options = new_options
218495
def _convert_dict_to_json(array):
    
    return json.dumps(
        array,
        skipkeys=False,
        allow_nan=False,
        indent=None,
        separators=(",", ":"),
        sort_keys=True,
        default=lambda o: o.__dict__,
    )
114802
def json(self):
        
        return json.dumps(self.dict_rules,
                          sort_keys=True,
                          indent=2,
                          separators=(',', ': '))
892303
def dump
      {
          'args'            => self.args,
          'worker'          => self.worker,
          'queue'           => self.queue,

          'status'          => self.status,
          'at'              => self.at,
          'total'           => self.total,
          'message'         => self.message,

          'payload'         => self.payload,
          'last_updated_at' => Time.now.to_i
      }
    end
1044741
def as_json(options = {})
      {name: self.name, title: self.title}.merge(options).tap do |options|
        fields.each {|f| options.merge!({f.code_name.to_sym => f.get_value_for(self)})}
      end
    end
941094
def as_json(options = {})
      root = options.key?(:root) ? options[:root] : true
      hash = if root && root_name
               { root_name => serializable_hash }
             else
               serializable_hash
             end
      hash[meta_key] = @options[:meta] if @options.key?(:meta)
      hash
    end
565003
def dumps(obj):
    """"""
    return json.dumps(obj, indent=4, sort_keys=True, cls=CustomEncoder)
998734
def json_dumps(cls, obj, **kwargs):
        
        if 'cls' not in kwargs:
            kwargs['cls'] = cls.json_encoder
        return json.dumps(obj, **kwargs)
1062855
def json_dumps(self, data, **options):
        
        params = {'sort_keys': True, 'indent': 2}
        params.update(options)
        # This code is based off django's built in JSON serializer
        if json.__version__.split('.') >= ['2', '1', '3']:
            # Use JS strings to represent Python Decimal instances (ticket #16850)
            params.update({'use_decimal': False})
        return json.dumps(data, cls=DjangoJSONEncoder, **params)
579178
def json_dumps(self, obj):
        """"""
        return json.dumps(obj, sort_keys=True, indent=4, separators=(',', ': '))
211320
def _to_json(self, sort_keys=False, indent=4):
        
        return json.dumps(self, sort_keys=sort_keys, indent=indent, cls=CtabAtomBondEncoder)
576604
def to_json(self, *args, **kwargs):
        
        return json.dumps(self.to_schema(), *args, **kwargs)
332561
def dumps(self):
        
        return json.dumps([self.__class__.__name__.lower(), self._kwargs])
419877
def as_json(obj: JsonObj, indent: Optional[str]='   ', **kwargs) -> str:
    
    return obj._as_json_dumps(indent, **kwargs)
1013817
def _get_validated_json(json_spec, args):
    
    if not json_spec:
        return
    if not args:
        return

    validated_spec = copy.deepcopy(json_spec)

    # print ignored keys if present in json_spec
    unsupported_keys = _get_unsupported_keys(validated_spec.keys(), SUPPORTED_KEYS)
    if len(unsupported_keys) > 0:
        logger.warn(
            "Warning: the following root level fields are not supported and will be ignored: {}"
                .format(", ".join(unsupported_keys)))


    if 'stages' in validated_spec:
        validated_spec['stages'] = _get_validated_stages(validated_spec['stages'])

    if 'name' in validated_spec:
        if args.src_dir != validated_spec['name']:
            logger.warn(
                'workflow name "%s" does not match containing directory "%s"' % (validated_spec['name'], args.src_dir))

    if 'ignoreReuse' in validated_spec:
        validate_ignore_reuse(validated_spec['stages'], validated_spec['ignoreReuse'])

    validated_documentation_fields = _get_validated_json_for_build_or_update(validated_spec, args)
    validated_spec.update(validated_documentation_fields)

    # Project-based workflow specific validation
    if args.mode == 'workflow':
        validated = _validate_json_for_regular_workflow(json_spec, args)
        validated_spec.update(validated)

    # Global workflow specific validation
    if args.mode == 'globalworkflow':
        _validate_json_for_global_workflow(validated_spec, args)

    return validated_spec
1108323
def encode_params(params, **kwargs):
    """"""
    cleaned = clean_params(params, **kwargs)
    return json.dumps(cleaned)
1225704
def to_json(self, extras=None):
        
        extras = extras or {}
        to_dict = model_to_dict(self)
        to_dict.update(extras)
        return json.dumps(to_dict, cls=sel.serializers.JsonEncoder)