String s = "{\"schema\":{\"$ref\":\"#/definitions/URLJumpConfig\"}}";
System.out.println(JSONObject.parseObject(s).toJSONString());
String s1 = "{\"schema\":{\"ref\":\"#/definitions/URLJumpConfig\"}}";
System.out.println(JSONObject.parseObject(s1).toJSONString());
String s2 = "{\"schema\":{\"$ref\":\"#/definitions/URLJumpConfig\"}}";
System.out.println(JSONObject.parseObject(s2).toJSONString());
控制台输出结果为
{"schema":{"$ref":"@"}}
{"schema":{"ref":"#/definitions/URLJumpConfig"}}
{"schema":{"$refs":"#/definitions/URLJumpConfig"}}
其中字符串s中$ref后面的值被转换为@
控制台输出结果为
{"schema":{"$ref":"@"}}
{"schema":{"ref":"#/definitions/URLJumpConfig"}}
{"schema":{"$refs":"#/definitions/URLJumpConfig"}}
其中字符串s中$ref后面的值被转换为@