スキル一覧に戻る
mcclowes

json-schema

by mcclowes

A constraint and probability-based programming language

1🍴 0📅 2026年1月12日
GitHubで見るManusで実行

SKILL.md


name: json-schema

prettier-ignore

description: Use when working with JSON Schema for validation, including draft-07, 2019-09, and 2020-12 specifications

JSON Schema

Quick Start

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "required": ["id", "name"],
  "properties": {
    "id": { "type": "integer", "minimum": 1 },
    "name": { "type": "string", "minLength": 1 },
    "email": { "type": "string", "format": "email" },
    "tags": {
      "type": "array",
      "items": { "type": "string" },
      "uniqueItems": true
    }
  },
  "additionalProperties": false
}

Core Keywords

  • Types: string, number, integer, boolean, array, object, null
  • String: minLength, maxLength, pattern, format
  • Number: minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf
  • Array: items, minItems, maxItems, uniqueItems, contains
  • Object: properties, required, additionalProperties, patternProperties
  • Composition: allOf, anyOf, oneOf, not
  • Conditional: if/then/else
  • References: $ref, $defs (or definitions in draft-07)

Common Formats

date-time, date, time, email, uri, uuid, ipv4, ipv6, regex

Ajv (JavaScript Validator)

import Ajv from 'ajv';
import addFormats from 'ajv-formats';

const ajv = new Ajv({ allErrors: true });
addFormats(ajv);

const validate = ajv.compile(schema);
if (!validate(data)) console.log(validate.errors);

Reference Files

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です