Serializes an argument to JSON, strips the quotes.
329242
<V> String toJson(final DataTypeDescriptor<V> descriptor, final V arg) {
		String s = format.write(arg, descriptor, false);
		TypeEnum type = descriptor.getType();
		if (type == TypeEnum.STRING || type == TypeEnum.ENUM || type == TypeEnum.DATETIME) {
			// Remove the quotes.
			s = s.substring(1, s.length() - 1);
		}

		return s;
	}
1367833
private char retrieveWrappingQuoteTypeOfJsonMemberNames(String jsonString) {
        char quote = '\"';   //  the default quote character used to specify json member names and string value according to the json specification
        for (char c : jsonString.toCharArray()) {
            if (c == '\'' || c == '\"') {
                quote = c;
                break;
            }
        }
        return quote;
    }
576604
def to_json(self, *args, **kwargs):
        
        return json.dumps(self.to_schema(), *args, **kwargs)
924130
def json(self, **kwargs):
        '''
        
        '''
        body = self._decompress(self.encoding)
        return _json.loads(body, **kwargs)
711644
def _encode_dict_as_string(value):
        """"""
        # Strip the first and last newlines
        if value.startswith("{\n"):
            value = "{" + value[2:]
        if value.endswith("\n}"):
            value = value[:-2] + "}"
        # escape double quotes and newlines
        return value.replace('"', '\\"').replace("\\n", "\\\\n").replace("\n", "\\n")
1108323
def encode_params(params, **kwargs):
    """"""
    cleaned = clean_params(params, **kwargs)
    return json.dumps(cleaned)
267340
protected JsonObject argumentsToJson() {
    JsonObject result = new JsonObject();
    for (Argument a : _arguments) {
      if (a.specified())
        result.addProperty(a._name,a.originalValue());
    }
    return result;
  }
1199111
def quote(value):
    
    if value == None:
        output = ""
    elif is_text(value):
        output = encode_basestring(value)
    else:
        output = _json.dumps(value)
    return output
486824
def tojson(val, indent=None):
    '''
    
    '''
    options = {'ensure_ascii': True}
    if indent is not None:
        options['indent'] = indent
    return (
        salt.utils.json.dumps(
            val, **options
        ).replace('<', '\\u003c')
         .replace('>', '\\u003e')
         .replace('&', '\\u0026')
         .replace("'", '\\u0027')
    )
483755
def serialize_args(args)
      return {} if args.nil?

      args.each do |key, value|
        case value
        when DateTime, Time
          args[key] = value.strftime('%m/%d/%Y %H:%M:%S')
        when Date
          args[key] = value.strftime('%m/%d/%Y')
        else
          # Especially for range operator (...), we want to output as String
          args[key] = value.to_s
        end
      end

      args
    end
9570
def serialize_args(self):
        """"""

        args, kwargs = super(ListParameter, self).serialize_args()
        args.insert(0, [self.param_type.id, self.param_type.serialize_args()])
1208210
def to_json(value, **kwargs):
        """"""
        if isinstance(value, HasProperties):
            return value.serialize(**kwargs)
        return value
419877
def as_json(obj: JsonObj, indent: Optional[str]='   ', **kwargs) -> str:
    
    return obj._as_json_dumps(indent, **kwargs)
378171
def as_json(self, ensure_ascii=False):
        """"""
        return json.dumps(self.as_dict, ensure_ascii=ensure_ascii)
1055519
function escapeJsonQuotes(json) {
      return JSON.stringify(json)
        .replace(/'/g, "&amp;apos;")
        .replace(/"/g, "&amp;quot;")
        /**
         * Codepen was unescaping &lt; (<) and &gt; (>) which caused, on some demos,
         * an unclosed elements (like <md-select>).
         * Used different unicode lookalike characters so it won't be considered as an element
         */
        .replace(/&amp;lt;/g, "&#x02C2;") // http://graphemica.com/%CB%82
        .replace(/&amp;gt;/g, "&#x02C3;"); // http://graphemica.com/%CB%83
    }
942257
def _strip_odict(wrapped):
    '''
    
    '''
    @functools.wraps(wrapped)
    def strip(*args):
        return salt.utils.json.loads(salt.utils.json.dumps(wrapped(*args)))
    return strip
1008073
def quoteattrs(data):
    ''''''
    items = []
    for key, value in data.items():
        items.append('{}={}'.format(key, quoteattr(value)))
    return ' '.join(items)