Skip to content
Back to skills

Json Schema

ASecurity

Use when working with JSON Schema for validation, OpenAPI schemas, type definitions, and data structure specification

  • 666 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added February 9, 2026
documentationapi

Works with

  • api

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill json-schema-mcclowes-omg --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Json Schema?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Json Schema
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-json-schema/badge)](https://www.skillsdirectory.com/skills/majiayu000-json-schema)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: json-schema
# prettier-ignore
description: Use when working with JSON Schema for validation, OpenAPI schemas, type definitions, and data structure specification
---

# JSON Schema

## Quick Start

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "required": ["id", "email"],
  "properties": {
    "id": { "type": "string", "format": "uuid" },
    "email": { "type": "string", "format": "email" },
    "age": { "type": "integer", "minimum": 0, "maximum": 150 },
    "role": { "enum": ["admin", "user", "guest"] },
    "tags": { "type": "array", "items": { "type": "string" } }
  }
}
```

## Type Keywords

| Type | Validation Keywords |
|------|---------------------|
| `string` | `minLength`, `maxLength`, `pattern`, `format` |
| `number/integer` | `minimum`, `maximum`, `exclusiveMinimum`, `multipleOf` |
| `array` | `items`, `minItems`, `maxItems`, `uniqueItems` |
| `object` | `properties`, `required`, `additionalProperties` |

## Composition

```json
{
  "allOf": [{ "$ref": "#/$defs/Base" }, { "properties": { "extra": {} } }],
  "oneOf": [{ "type": "string" }, { "type": "number" }],
  "anyOf": [{ "minimum": 0 }, { "maximum": 100 }],
  "not": { "type": "null" }
}
```

## References

```json
{
  "$defs": {
    "Address": {
      "type": "object",
      "properties": { "street": { "type": "string" } }
    }
  },
  "properties": {
    "billing": { "$ref": "#/$defs/Address" },
    "shipping": { "$ref": "#/$defs/Address" }
  }
}
```

## Common Formats

`date-time`, `date`, `time`, `email`, `uri`, `uuid`, `ipv4`, `ipv6`, `hostname`

## OpenAPI 3.1 Notes

- OpenAPI 3.1 uses JSON Schema 2020-12
- Use `nullable` via `type: ["string", "null"]`
- `example` for single example, `examples` for multiple
- `$ref` can have siblings in 3.1 (not in 3.0)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.