Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

{"schema":{"$refs":"#/values"}}转换为json然后再转换为string,$refs后面的值被转换为@ #3336

Closed
xiaochengzila opened this issue Jul 9, 2020 · 0 comments

Comments

@xiaochengzila
Copy link

xiaochengzila commented Jul 9, 2020

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后面的值被转换为@

@xiaochengzila xiaochengzila changed the title string转换为json然后再转换为string,结果字符串与原字符串不相等 {"schema":{"$refs":"#/values"}}转换为json然后再转换为string,$refs后面的值被转换为@ Jul 9, 2020
@wenshao wenshao closed this as completed in b8b947a Jul 9, 2020
wenshao added a commit that referenced this issue Jul 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant