We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
简要描述您碰到的问题。
FastJson2, JsonSchema, type为数组问题时,JsonSchema对象被处理为 x: {}
示例: public static void main(String[] args) throws IOException {
// 定义必须包含longitude和latitude两个属性,其中longitude的取值范围是[-180 ~ 180],latitude的取值范围是[-90, 90] JSONSchema schema = JSONSchema.of(JSON.parseObject("{\"type\":\"object\",\"properties\":{\"longitude\":{\"type\":[\"string\", \"number\"]},\"latitude\":{\"type\":\"number\",\"minimum\":-90,\"maximum\":-90}},\"required\":[\"longitude\",\"latitude\"]}")); // 校验JSONObject对象,校验通过 System.out.println(schema); }
结果:
{"type":"object","properties":{"longitude":{},"latitude":{"type":"number","minimum":-90,"maximum":-90}},"required":["longitude","latitude"]}
The text was updated successfully, but these errors were encountered:
jsonschema support array type, for issue #2931
3ed22a9
https://github.com/alibaba/fastjson2/releases/tag/2.0.53 问题已修复,请用新版本
Sorry, something went wrong.
No branches or pull requests
问题描述
简要描述您碰到的问题。
FastJson2, JsonSchema, type为数组问题时,JsonSchema对象被处理为 x: {}
示例:
public static void main(String[] args) throws IOException {
结果:
{"type":"object","properties":{"longitude":{},"latitude":{"type":"number","minimum":-90,"maximum":-90}},"required":["longitude","latitude"]}
The text was updated successfully, but these errors were encountered: