Skip to content

Commit 3fdcd68

Browse files
authored
Merge pull request #3 from json-structure/reorganize-samples
Reorganize samples: move schemas into directories, restructure imports
2 parents e1c368f + 950180d commit 3fdcd68

File tree

73 files changed

+4460
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+4460
-9
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://schemas.example.com/basic-person",
3+
"firstName": "John",
4+
"lastName": "Doe",
5+
"dateOfBirth": "1990-05-15",
6+
"email": "john.doe@example.com",
7+
"age": 33,
8+
"profileData": {
9+
"preferences": {
10+
"theme": "dark",
11+
"notifications": true
12+
},
13+
"badges": ["verified", "premium"]
14+
},
15+
"isActive": true
16+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://schemas.example.com/basic-person",
3+
"firstName": "Jane",
4+
"lastName": "Smith",
5+
"dateOfBirth": "1985-12-03",
6+
"email": "jane.smith@company.org",
7+
"age": 28,
8+
"profileData": "Simple string profile"
9+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://schemas.example.com/basic-person",
3+
"firstName": "Michael",
4+
"lastName": "Johnson",
5+
"dateOfBirth": "1978-09-22",
6+
"email": "mike.j@example.net",
7+
"isActive": false
8+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"$schema": "https://json-structure.org/meta/core/v0/#",
3+
"$id": "https://schemas.example.com/basic-person",
4+
"name": "Person",
5+
"type": "object",
6+
"description": "A basic person schema demonstrating primitive types",
7+
"properties": {
8+
"firstName": {
9+
"type": "string",
10+
"description": "The person's first name",
11+
"maxLength": 50
12+
},
13+
"lastName": {
14+
"type": "string",
15+
"description": "The person's last name",
16+
"maxLength": 50
17+
},
18+
"dateOfBirth": {
19+
"type": "date",
20+
"description": "The person's date of birth"
21+
},
22+
"email": {
23+
"type": "string",
24+
"description": "The person's email address",
25+
"examples": ["john.doe@example.com"]
26+
},
27+
"age": {
28+
"type": "int8",
29+
"description": "The person's age in years (0-127)"
30+
},
31+
"profileData": {
32+
"type": "any",
33+
"description": "Flexible profile data - can be any JSON value"
34+
},
35+
"isActive": {
36+
"type": "boolean",
37+
"description": "Whether the person is currently active",
38+
"default": true
39+
}
40+
},
41+
"required": ["firstName", "lastName", "email"]
42+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://schemas.example.com/address",
3+
"street": "123 Main Street",
4+
"city": "New York",
5+
"state": "New York",
6+
"zipCode": "10001",
7+
"country": "US"
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://schemas.example.com/address",
3+
"street": "456 Oak Avenue",
4+
"city": "Toronto",
5+
"state": "Ontario",
6+
"zipCode": "M5V 3A8",
7+
"country": "CA"
8+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "https://schemas.example.com/address",
3+
"street": "789 Queen Street",
4+
"city": "London",
5+
"country": "UK"
6+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "https://json-structure.org/meta/core/v0/#",
3+
"$id": "https://schemas.example.com/address",
4+
"name": "Address",
5+
"type": "object",
6+
"description": "An address schema demonstrating required fields and additional properties",
7+
"properties": {
8+
"street": {
9+
"type": "string",
10+
"description": "Street address line",
11+
"maxLength": 100
12+
},
13+
"city": {
14+
"type": "string",
15+
"description": "City name",
16+
"maxLength": 50
17+
},
18+
"state": {
19+
"type": "string",
20+
"description": "State or province",
21+
"maxLength": 50
22+
},
23+
"zipCode": {
24+
"type": "string",
25+
"description": "Postal/ZIP code",
26+
"maxLength": 20
27+
},
28+
"country": {
29+
"type": "string",
30+
"description": "Country code",
31+
"enum": ["US", "CA", "MX", "UK", "DE", "FR", "JP", "AU"],
32+
"examples": ["US", "CA"]
33+
}
34+
},
35+
"required": ["street", "city", "country"],
36+
"additionalProperties": false
37+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"$schema": "https://schemas.example.com/financial-types",
3+
"invoiceNumber": "INV-2023-001",
4+
"issueDate": "2023-11-13",
5+
"dueDate": "2023-12-13",
6+
"paymentTermsDays": 30,
7+
"lineItems": [
8+
{
9+
"description": "Professional Services",
10+
"quantity": 10,
11+
"unitPrice": {
12+
"amount": "150.00",
13+
"currency": "USD"
14+
},
15+
"totalPrice": {
16+
"amount": "1500.00",
17+
"currency": "USD"
18+
},
19+
"weight": 0.0,
20+
"discountPercent": 0
21+
},
22+
{
23+
"description": "Software License",
24+
"quantity": 1,
25+
"unitPrice": {
26+
"amount": "299.99",
27+
"currency": "USD"
28+
},
29+
"totalPrice": {
30+
"amount": "299.99",
31+
"currency": "USD"
32+
},
33+
"weight": 0.5,
34+
"discountPercent": 10.5
35+
}
36+
],
37+
"subtotal": {
38+
"amount": "1799.99",
39+
"currency": "USD"
40+
},
41+
"taxRate": "0.0875",
42+
"taxAmount": {
43+
"amount": "157.50",
44+
"currency": "USD"
45+
},
46+
"totalAmount": {
47+
"amount": "1957.49",
48+
"currency": "USD"
49+
},
50+
"cancelledDate": null
51+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"$schema": "https://schemas.example.com/financial-types",
3+
"invoiceNumber": "INV-2023-002",
4+
"issueDate": "2023-11-14",
5+
"dueDate": "2023-11-28",
6+
"paymentTermsDays": 14,
7+
"lineItems": [
8+
{
9+
"description": "Monthly Subscription",
10+
"quantity": 1,
11+
"unitPrice": {
12+
"amount": "49.99",
13+
"currency": "EUR"
14+
},
15+
"totalPrice": {
16+
"amount": "49.99",
17+
"currency": "EUR"
18+
},
19+
"weight": 0.0,
20+
"discountPercent": 0
21+
}
22+
],
23+
"subtotal": {
24+
"amount": "49.99",
25+
"currency": "EUR"
26+
},
27+
"totalAmount": {
28+
"amount": "49.99",
29+
"currency": "EUR"
30+
},
31+
"cancelledDate": "2023-11-20"
32+
}

0 commit comments

Comments
 (0)