https://github.com/divedylan/node-schema
a simple node schema
https://github.com/divedylan/node-schema
Last synced: about 1 year ago
JSON representation
a simple node schema
- Host: GitHub
- URL: https://github.com/divedylan/node-schema
- Owner: diveDylan
- Created: 2020-07-20T09:54:02.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-22T15:14:24.000Z (almost 6 years ago)
- Last Synced: 2025-03-28T12:33:12.180Z (about 1 year ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
### Document
a node schema tool
### Usage
```bash
cd json
mkdir
cd root
node app
```
### JSON
```json
{
"title": "schema的title",
"description": "schema description",
"json": {
}
}
```
### Schema
```json
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "响应格式",
"description": "响应格式规范",
"type": "object",
"properties": {
"code": {
"type": "string"
"description": "响应状态码的枚举,具体见后端定义的enum response code"
},
"message": {
"type": "string",
"description": "响应的信息,一般是针对整个响应的概况,成功,错误信息等"
},
"data": {
"type": "object | array",
"description": "响应的具体内容"
}
},
"required": [
"code",
"message",
"data"
]
}
```