跳至内容

json-schema-plus

一个 vscode 扩展插件 为 JSON Schema 提供了多语言的动态架构匹配

如何使用它

TIP

abgox/schema 中的 scoop-manifest.*.json 为例

  1. 安装 json-schema-plus

  2. 添加以下配置到工作区 settings.json 配置文件中,参考 abgox/abyss

    json
    "json-schema-plus.schemas": [
     {
       "fileMatch": ["bucket/**/*.json"],
       "urls": [
         {
           "language": "zh",
           "url": "https://schema.abgox.com/scoop-manifest.zh-CN.json"
         },
       ],
       "url": "https://schema.abgox.com/scoop-manifest.en-US.json"
     }
    ]
  3. 它会根据当前的语言环境自动加载对应的 Schema 架构

    • 如果为 zh-CN
      • 它会匹配到 urls 中的 zh
      • 则会加载 https://schema.abgox.com/scoop-manifest.zh-CN.json
    • 如果为 en-US
      • urls 中没有相关的定义
      • 则会加载 url 定义的 https://schema.abgox.com/scoop-manifest.en-US.json

喜欢这个项目?请给它 Star ⭐️ 或 赞赏 💰

Released under the MIT.