跳至内容

schema

一些 JSON Schema,提供更好的 json 提示和校验,同时支持多语言

如何使用

  • 在 json 文件中定义

    json
    "$schema": "https://schema.abgox.com/scoop-manifest.zh-CN.json",
  • 在 vscode 的 settings.json 中定义

    • 安装 json-schema-plus 扩展,它为 JSON Schema 提供了多语言的动态架构匹配

    • 配置 json-schema-plus.schemas

      json
      "json-schema-plus.schemas": [
        {
          "fileMatch": [
            "bucket/**/*.json"
          ],
          "url": "https://schema.abgox.com/scoop-manifest.en-US.json",
          "urls": [
            {
              "language": "zh",
              "url": "https://schema.abgox.com/scoop-manifest.zh-CN.json"
            },
          ]
        }
      ]
    使用内置的 json.schemas 配置

    settings.json 中定义的 json.schemas 优先级低于扩展提供的 schema,参考 issue

    json
    "json.schemas": [
      {
        "fileMatch": [
          "bucket/**/*.json"
        ],
        "url": "https://schema.abgox.com/scoop-manifest.zh-CN.json"
      }
    ]
  • JetBrains IDE: 设置 => 语言与框架 => 架构和 DTD => JSON 架构映射


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

Released under the MIT.