उपयोगकर्ता JSON Schema
मध्यम JSON Schema
आवश्यक फ़ील्ड्स, पैटर्न और enums के साथ उपयोगकर्ता ऑब्जेक्ट्स को सत्यापित करने के लिए एक JSON Schema। कॉपी करने के लिए तैयार।
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/user.schema.json",
"title": "User",
"description": "A user account in the system.",
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^usr_[a-z0-9]{6}$",
"description": "Unique user identifier"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"email": {
"type": "string",
"format": "email"
},
"age": {
"type": "integer",
"minimum": 0,
"maximum": 150
},
"role": {
"type": "string",
"enum": ["admin", "editor", "viewer"]
}
},
"required": ["id", "name", "email"],
"additionalProperties": false
} टूल में खोलें
संबंधित उपकरण
और उदाहरण
- schema
- user
- validation