json-schema
Use when working with JSON Schema for validation, including draft-07, 2019-09, and 2020-12 specifications
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use when working with JSON Schema for validation, including draft-07, 2019-09, and 2020-12 specifications
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when writing Vague (.vague) files that need realistic test data using faker generators for names, emails, addresses, dates, and more
Use when writing Vague (.vague) files - a declarative language for generating realistic test data with superposition, constraints, and cross-references
Use when adding syntax highlighting for custom languages to Prism.js, used by Docusaurus and many documentation sites
Use when configuring Spectral for API linting, creating custom rulesets, and validating OpenAPI or AsyncAPI specifications
Use when developing TypeScript npm packages including tsconfig, package.json exports, dual CJS/ESM builds, and publishing
Use when writing or modifying Vitest tests to follow best practices for test structure, assertions, mocking, and coverage
| name | json-schema |
| description | Use when working with JSON Schema for validation, including draft-07, 2019-09, and 2020-12 specifications |
{
"$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
}
string, number, integer, boolean, array, object, nullminLength, maxLength, pattern, formatminimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOfitems, minItems, maxItems, uniqueItems, containsproperties, required, additionalProperties, patternPropertiesallOf, anyOf, oneOf, notif/then/else$ref, $defs (or definitions in draft-07)date-time, date, time, email, uri, uuid, ipv4, ipv6, regex
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);