Skip to content

Commit 00000a4

Browse files
author
Clemens Vasters
committed
Reorganize samples: move schemas into directories, restructure imports
Core samples: - Move all schema files into their respective numbered directories - Each directory now contains schema.struct.json + example files - Update validate-all.ps1 with new paths - Update README.md with new directory structure Import samples: - Renumber examples from 03-06 to 01-04 - Move library schemas (person-library, financial-library) into 02-namespace-import/ - Update all import references to use relative paths - Update validate-imports.ps1 with new structure - Update README.md to document reorganized layout All validations pass successfully.
1 parent e1c368f commit 00000a4

Some content is hidden

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

69 files changed

+3906
-0
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: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
"lineItems": [
7+
{
8+
"description": "Professional Services",
9+
"quantity": "10.000",
10+
"unitPrice": {
11+
"amount": "150.00",
12+
"currency": "USD"
13+
},
14+
"totalPrice": {
15+
"amount": "1500.00",
16+
"currency": "USD"
17+
}
18+
},
19+
{
20+
"description": "Software License",
21+
"quantity": "1.000",
22+
"unitPrice": {
23+
"amount": "299.99",
24+
"currency": "USD"
25+
},
26+
"totalPrice": {
27+
"amount": "299.99",
28+
"currency": "USD"
29+
}
30+
}
31+
],
32+
"subtotal": {
33+
"amount": "1799.99",
34+
"currency": "USD"
35+
},
36+
"taxRate": "0.0875",
37+
"taxAmount": {
38+
"amount": "157.50",
39+
"currency": "USD"
40+
},
41+
"totalAmount": {
42+
"amount": "1957.49",
43+
"currency": "USD"
44+
}
45+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
"lineItems": [
7+
{
8+
"description": "Monthly Subscription",
9+
"quantity": "1.000",
10+
"unitPrice": {
11+
"amount": "49.99",
12+
"currency": "EUR"
13+
},
14+
"totalPrice": {
15+
"amount": "49.99",
16+
"currency": "EUR"
17+
}
18+
}
19+
],
20+
"subtotal": {
21+
"amount": "49.99",
22+
"currency": "EUR"
23+
},
24+
"totalAmount": {
25+
"amount": "49.99",
26+
"currency": "EUR"
27+
}
28+
}

0 commit comments

Comments
 (0)