chore: bump @kevisual/router to version 0.0.80, update QueryApi to handle optional fields in metadata args, and enhance JSON Schema conversion

This commit is contained in:
2026-02-18 12:58:44 +08:00
parent 73a9868c19
commit 05dace0c79
10 changed files with 183 additions and 37 deletions

View File

@@ -12,14 +12,14 @@ const api = {
"path": "test",
"key": "test",
"description": "test route",
"type": "route",
"middleware": [],
"metadata": {
"args": {
"a": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "arg a",
"type": "string"
"type": "string",
"optional": true
}
}
}
@@ -40,16 +40,16 @@ const api = {
"path": "demo",
"key": "d1",
"description": "First demo route demonstrating string and number parameters",
"type": "route",
"middleware": [],
"metadata": {
"args": {
"username": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "The username to be validated, must be between 3 and 20 characters",
"type": "string",
"minLength": 3,
"maxLength": 20,
"description": "The username to be validated, must be between 3 and 20 characters"
"optional": true
},
"age": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
@@ -94,7 +94,6 @@ const api = {
"path": "demo",
"key": "d2",
"description": "Second demo route for boolean and enum parameters",
"type": "route",
"middleware": [],
"metadata": {
"args": {
@@ -145,7 +144,6 @@ const api = {
"path": "demo",
"key": "d3",
"description": "Third demo route handling array and optional parameters",
"type": "route",
"middleware": [],
"metadata": {
"args": {
@@ -182,7 +180,8 @@ const api = {
"description": "Priority level from 1 to 5, defaults to 3 if not specified",
"type": "number",
"minimum": 1,
"maximum": 5
"maximum": 5,
"optional": true
},
"keywords": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
@@ -208,7 +207,6 @@ const api = {
"path": "demo",
"key": "d4",
"description": "Fourth demo route with nested object parameters",
"type": "route",
"middleware": [],
"metadata": {
"args": {
@@ -309,7 +307,8 @@ const api = {
"city",
"country"
],
"additionalProperties": false
"additionalProperties": false,
"optional": true
}
}
}
@@ -329,7 +328,6 @@ const api = {
"path": "demo",
"key": "d5",
"description": "Fifth demo route with mixed complex parameters and validation",
"type": "route",
"middleware": [],
"metadata": {
"args": {
@@ -434,14 +432,16 @@ const api = {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"default": false,
"description": "Whether to include metadata in response",
"type": "boolean"
"type": "boolean",
"optional": true
},
"timeout": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Request timeout in milliseconds, between 1s and 30s",
"type": "number",
"minimum": 1000,
"maximum": 30000
"maximum": 30000,
"optional": true
},
"retry": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
@@ -449,7 +449,8 @@ const api = {
"description": "Number of retry attempts on failure",
"type": "integer",
"minimum": 0,
"maximum": 5
"maximum": 5,
"optional": true
}
}
}
@@ -463,7 +464,6 @@ const api = {
"path": "router",
"key": "list",
"description": "列出当前应用下的所有的路由信息",
"type": "route",
"middleware": []
}
}