feat: mock配置迁移至JSON格式并修复body匹配

- 将mock配置从YAML格式迁移到JSON格式
- 修复JSON字符串格式body匹配失败问题
- 添加MCP功能模块
- 更新mock-spec.md规范文档

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-29 09:43:11 +08:00
parent 061ceff4b8
commit d364307131
42 changed files with 1509 additions and 893 deletions

View File

@@ -3,6 +3,10 @@ name = "mock_server"
version = "0.1.0"
edition = "2024"
[features]
default = []
mcp = ["rmcp", "schemars"]
[dependencies]
# 核心 Web 框架
axum = "0.8.8"
@@ -12,9 +16,8 @@ tokio={version = "1.48.0",features = ["full"]}
tokio-util = {version = "0.7.17",features = ["io"]}
futures-util = "0.3.31"
# 序列化与 YAML 解析
# 序列化
serde = {version = "1.0.228",features = ["derive"]}
serde_yaml = "0.9.34+deprecated"
serde_json = "1.0.147"
# 物理目录递归扫描工具
@@ -23,13 +26,13 @@ walkdir = "2.5.0"
tracing="0.1.44"
tracing-subscriber = "0.3.22"
# 性能优化:快速哈希(可选,用于路由匹配)
#dashmap = "7.0.0-rc2"
# 热加载支持(扩展功能)
notify = "8.2.0"
notify-debouncer-mini = "0.6.0"
# 路径处理
#pathdiff = "0.2.3"
# MCP Server 支持(可选)
rmcp = { version = "0.1", features = ["server"], optional = true }
schemars = { version = "0.8", optional = true }
[dev-dependencies]
tempfile = "3.24.0"