# json-schema **Repository Path**: millinch/json-schema ## Basic Information - **Project Name**: json-schema - **Description**: JSON 模型 Schema 定义 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-03-17 - **Last Updated**: 2023-03-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # json-schema #### 介绍 对于每一个表,都应该有它的业务元数据,描述生成前后端代码 CRUD 所必要的信息,供模板使用。 数据格式:JSON/YAML ,通过 JSON Schema 规范 JSON 格式,要支持版本区分。 参考链接: - [JSON Schema 官方](https://json-schema.org/understanding-json-schema/index.html) - [JSON Schema 规范中文版](https://json-schema.apifox.cn/) - [JSON Schema Validator](https://github.com/networknt/json-schema-validator) #### IDEA 使用说明 打开设置,搜索 `json schema`,找到 `JSON Schema Mappings` 配置项,再在右侧点击 ➕ 添加一个,如图: ![idea-json-schema-setting](https://gitee.com/millinch/json-schema/raw/master/assets/idea-json-schema-setting.png) 配置完成后,所有`*.model.json` 都会受指定 schema 文件规范约束,IDEA会有代码补全提示、格式错误等警告。 ![idea-json-sample](https://gitee.com/millinch/json-schema/raw/master/assets/idea-json-sample.png) #### VS Code 使用说明 打开设置 Setting,搜索 `json schema`, 点击 `Edit in setting.json`, 如图: ![vscode-json-schema-setting](https://gitee.com/millinch/json-schema/raw/master/assets/vscode-json-schema-setting.png) 在 `json.schemas` 中添加配置: ```json "json.schemas": [ { "fileMatch": [ "*.model.json" ], "url": "https://gitee.com/millinch/json-schema/raw/master/model.schema.json" } ] ```