113 lines
2.4 KiB
JSON
113 lines
2.4 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"$id": "https://example.com/user-profile.schema.json",
|
|
"title": "User Profile",
|
|
"description": "A user profile containing name, age, and tags",
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"description": "User's full name",
|
|
"minLength": 1,
|
|
"pattern": "^[A-Za-z\\s]+$"
|
|
},
|
|
"age": {
|
|
"type": "number",
|
|
"description": "User's age in years",
|
|
"minimum": 0,
|
|
"maximum": 150
|
|
},
|
|
"email": {
|
|
"type": "string",
|
|
"description": "User's email address",
|
|
"format": "email"
|
|
},
|
|
"tags": {
|
|
"type": "array",
|
|
"description": "List of user's tags",
|
|
"items": {
|
|
"type": "string",
|
|
"enum": [
|
|
"developer",
|
|
"designer",
|
|
"manager",
|
|
"admin",
|
|
"user"
|
|
]
|
|
},
|
|
"minItems": 1,
|
|
"maxItems": 5,
|
|
"uniqueItems": true
|
|
},
|
|
"address": {
|
|
"type": "object",
|
|
"description": "User's address",
|
|
"properties": {
|
|
"street": {
|
|
"type": "string",
|
|
"description": "Street address"
|
|
},
|
|
"city": {
|
|
"type": "string",
|
|
"description": "City name"
|
|
},
|
|
"country": {
|
|
"type": "string",
|
|
"description": "Country name",
|
|
"enum": [
|
|
"US",
|
|
"UK",
|
|
"CA",
|
|
"AU"
|
|
]
|
|
},
|
|
"zipCode": {
|
|
"type": "string",
|
|
"description": "ZIP/Postal code",
|
|
"pattern": "^[0-9]{5}(-[0-9]{4})?$"
|
|
}
|
|
},
|
|
"required": [
|
|
"street",
|
|
"city",
|
|
"country"
|
|
]
|
|
},
|
|
"preferences": {
|
|
"type": "object",
|
|
"description": "User preferences",
|
|
"properties": {
|
|
"theme": {
|
|
"type": "string",
|
|
"enum": [
|
|
"light",
|
|
"dark",
|
|
"system"
|
|
],
|
|
"default": "system"
|
|
},
|
|
"notifications": {
|
|
"type": "boolean",
|
|
"default": true
|
|
},
|
|
"language": {
|
|
"type": "string",
|
|
"enum": [
|
|
"en",
|
|
"es",
|
|
"fr",
|
|
"de",
|
|
"ja"
|
|
],
|
|
"default": "en"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"age",
|
|
"email"
|
|
],
|
|
"additionalProperties": false
|
|
} |