use-config/config/app-schema.json

87 lines
1.9 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "App Configuration Schema",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"inline-app",
"micro-app"
],
"$comment": "Type must be either 'inline-app' or 'micro-app'"
},
"single": {
"type": "boolean",
"$comment": "是否单例模式,独立启动服务。"
},
"port": {
"type": "integer",
"minimum": 0,
"maximum": 65535,
"$comment": "开发和单例启动服务的端口"
},
"remote": {
"type": "object",
"properties": {
"host": {
"type": "string",
"format": "hostname"
},
"path": {
"type": "string",
"pattern": "^/.*"
}
},
"required": [
"host",
"path"
]
},
"micro": {
"type": "object",
"properties": {
"serve": {
"type": "object",
"properties": {
"name": {
"type": "string",
"pattern": "^[a-z0-9-]+$",
"$comment": "服务名称"
},
"port": {
"type": "integer",
"minimum": 0,
"maximum": 65535,
"$comment": "启动的服务端口"
}
},
"required": []
},
"remote": {
"type": "object",
"properties": {
"host": {
"type": "string",
"format": "hostname"
},
"port": {
"type": "integer",
"minimum": 0,
"maximum": 65535,
"$comment": "链接的远程地址的端口"
}
},
"required": [
"host",
"port"
]
}
},
"required": []
}
},
"required": [
"type"
]
}