Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{"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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant