Примеры JSON
Примеры формата JSON (JavaScript Object Notation) от простых до сложных структур
Key Facts
- Category
- Data Formats
- Items
- 10
- Format Families
- json
Sample Overview
Примеры формата JSON (JavaScript Object Notation) от простых до сложных структур This sample set belongs to Data Formats and can be used to test related workflows inside Elysia Tools.
📋 Простой объект JSON json
Базовый объект JSON с парами ключ-значение
{
"name": "John Doe",
"age": 30,
"isStudent": false,
"email": "[email protected]"
}
📋 Массив JSON json
Массив JSON, содержащий несколько значений
[
"apple",
"banana",
"cherry",
"date",
"elderberry"
]
📋 JSON с пустыми значениями json
JSON, демонстрирующий различные представления пустых значений
{
"emptyString": "",
"nullValue": null,
"emptyArray": [],
"emptyObject": {},
"zeroNumber": 0,
"zeroDecimal": 0.0,
"falseBoolean": false
}
📋 Массив объектов JSON json
Массив JSON, содержащий несколько объектов
[
{
"id": 1,
"name": "Alice",
"age": 25,
"city": "New York"
},
{
"id": 2,
"name": "Bob",
"age": 30,
"city": "London"
},
{
"id": 3,
"name": "Charlie",
"age": 35,
"city": "Tokyo"
}
]
📋 Вложенный объект JSON json
Объект JSON, содержащий вложенные объекты
{
"user": {
"name": "John Doe",
"profile": {
"age": 30,
"gender": "male",
"address": {
"street": "123 Main St",
"city": "New York",
"country": "USA"
}
}
}
}
📋 JSON с смешанными типами json
Объект JSON с различными типами данных, включая массивы, объекты и примитивы
{
"name": "Product Catalog",
"version": 1.0,
"isActive": true,
"products": [
{
"id": "P001",
"name": "Laptop",
"price": 999.99,
"inStock": 10,
"tags": ["electronics", "computers"]
},
{
"id": "P002",
"name": "Smartphone",
"price": 599.99,
"inStock": 25,
"tags": ["electronics", "mobile"]
}
],
"lastUpdated": "2025-01-01T12:00:00Z"
}
📋 Ответ API в формате JSON json
Стандартная структура JSON для ответов API
{
"status": "success",
"code": 200,
"message": "Request processed successfully",
"timestamp": "2025-01-01T12:00:00Z",
"data": {
"user": {
"id": "USER12345",
"name": "John Doe",
"email": "[email protected]",
"profile": {
"age": 30,
"gender": "male",
"joinedAt": "2024-01-01T00:00:00Z"
},
"roles": ["user", "subscriber"]
}
},
"pagination": {
"currentPage": 1,
"totalPages": 5,
"totalItems": 45,
"itemsPerPage": 10
},
"meta": {
"requestId": "REQ-789012",
"version": "1.0.0"
}
}
📋 JSON конфигурации json
JSON для настроек конфигурации
{
"app": {
"name": "My Application",
"version": "1.2.3",
"environment": "production",
"debug": false,
"port": 3000
},
"database": {
"type": "postgres",
"host": "localhost",
"port": 5432,
"name": "myapp_db",
"credentials": {
"username": "db_user",
"password": "DB_PASSWORD",
"ssl": true
},
"pool": {
"min": 2,
"max": 10
}
},
"logging": {
"level": "info",
"format": "json",
"outputs": ["console", "file"],
"file": {
"path": "/var/log/myapp.log",
"maxSize": "10MB",
"maxFiles": 5
}
},
"security": {
"cors": {
"enabled": true,
"origins": ["https://elysiatools.com", "https://app.example.com"],
"methods": ["GET", "POST", "PUT", "DELETE"]
},
"jwt": {
"secret": "JWT_SECRET",
"expiresIn": "7d"
}
},
"services": {
"payment": {
"gateway": "stripe",
"apiKey": "STRIPE_API_KEY",
"webhookSecret": "STRIPE_WEBHOOK_SECRET"
},
"email": {
"provider": "sendgrid",
"apiKey": "SENDGRID_API_KEY",
"from": "[email protected]"
}
}
}
📋 Сложная структура JSON json
Сложный JSON с вложенными массивами, объектами и различными типами данных
{
"company": {
"name": "Tech Corp",
"founded": 2000,
"industry": "Technology",
"location": {
"country": "USA",
"city": "San Francisco",
"coordinates": {
"lat": 37.7749,
"lng": -122.4194
}
},
"departments": [
{
"name": "Engineering",
"head": "Alice Smith",
"employees": [
{
"id": "EMP001",
"name": "Bob Johnson",
"position": "Software Engineer",
"skills": ["JavaScript", "Python", "React"]
},
{
"id": "EMP002",
"name": "Charlie Davis",
"position": "Backend Developer",
"skills": ["Go", "Node.js", "PostgreSQL"]
}
],
"projects": [
{
"name": "Project Alpha",
"status": "active",
"deadline": "2025-06-01"
},
{
"name": "Project Beta",
"status": "planning",
"deadline": "2025-09-01"
}
]
},
{
"name": "Marketing",
"head": "Diana Evans",
"employees": [
{
"id": "EMP003",
"name": "Ethan Wilson",
"position": "Marketing Manager",
"skills": ["Digital Marketing", "SEO", "Social Media"]
}
],
"projects": [
{
"name": "Campaign X",
"status": "active",
"deadline": "2025-05-15"
}
]
}
],
"financials": {
"revenue": 1000000000,
"profit": 150000000,
"expenses": 850000000,
"quarters": [
{ "quarter": 1, "revenue": 240000000, "profit": 35000000 },
{ "quarter": 2, "revenue": 250000000, "profit": 40000000 },
{ "quarter": 3, "revenue": 260000000, "profit": 45000000 },
{ "quarter": 4, "revenue": 250000000, "profit": 30000000 }
]
},
"tags": ["tech", "innovation", "growth"]
}
}
📋 Пример GeoJSON json
Формат GeoJSON для представления географических данных
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"name": "San Francisco",
"population": 873965,
"cityClass": "major"
},
"geometry": {
"type": "Point",
"coordinates": [-122.4194, 37.7749]
}
},
{
"type": "Feature",
"properties": {
"name": "New York City",
"population": 8804190,
"cityClass": "major"
},
"geometry": {
"type": "Point",
"coordinates": [-74.006, 40.7128]
}
},
{
"type": "Feature",
"properties": {
"name": "Los Angeles",
"population": 3898747,
"cityClass": "major"
},
"geometry": {
"type": "Point",
"coordinates": [-118.2437, 34.0522]
}
},
{
"type": "Feature",
"properties": {
"name": "California",
"state": "CA"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-124.48201944037265, 40.440630133689096],
[-124.38966410701322, 37.18018892607658],
[-122.2344979653738, 36.99742992327278],
[-114.13122416650424, 32.534136409845824],
[-114.6399218947989, 40.39573804578282],
[-124.48201944037265, 40.440630133689096]
]
]
}
}
]
}