|
1 | 1 | { |
2 | | - "caseTitle": "Example", |
3 | | - "caseDesc": "A brief description of what this example demonstrates.", |
4 | | - "tags": ["BSC", "opBNB"], |
5 | | - "github": "GitHub repository link for this example.", |
6 | | - "replit": "Replit repository link for this example.", |
7 | | - "video": { |
8 | | - "type": "ype of video source (e.g., youtube, file).", |
9 | | - "link": "URL link to the video." |
10 | | - }, |
11 | | - "guide": "Additional guide document link.", |
12 | | - "otherLink": "Link to related resource or external page.", |
13 | | - "imgUrl": "URL of the thumbnail image." |
| 2 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 3 | + "title": "Example Meta Schema", |
| 4 | + "description": "A JSON Schema for validating an array of example metadata objects.", |
| 5 | + "type": "array", |
| 6 | + "items": { |
| 7 | + "type": "object", |
| 8 | + "properties": { |
| 9 | + "caseTitle": { |
| 10 | + "type": "string", |
| 11 | + "description": "The title of the case/example." |
| 12 | + }, |
| 13 | + "caseDesc": { |
| 14 | + "type": "string", |
| 15 | + "description": "A brief description of the case/example." |
| 16 | + }, |
| 17 | + "tags": { |
| 18 | + "type": "array", |
| 19 | + "description": "An array of tags associated with the case.", |
| 20 | + "items": { |
| 21 | + "type": "string" |
| 22 | + } |
| 23 | + }, |
| 24 | + "github": { |
| 25 | + "type": "string", |
| 26 | + "description": "GitHub repository link for the example." |
| 27 | + }, |
| 28 | + "replit": { |
| 29 | + "type": "string", |
| 30 | + "description": "Replit repository link for the example." |
| 31 | + }, |
| 32 | + "video": { |
| 33 | + "type": "object", |
| 34 | + "description": "Video metadata can be empty or if used must include both 'type' and 'link'.", |
| 35 | + "anyOf": [ |
| 36 | + { |
| 37 | + "maxProperties": 0 |
| 38 | + }, |
| 39 | + { |
| 40 | + "required": [ |
| 41 | + "type", |
| 42 | + "link" |
| 43 | + ], |
| 44 | + "properties": { |
| 45 | + "type": { |
| 46 | + "type": "string", |
| 47 | + "description": "The video source type (e.g., youtube, file)." |
| 48 | + }, |
| 49 | + "link": { |
| 50 | + "type": "string", |
| 51 | + "description": "The URL link to the video." |
| 52 | + } |
| 53 | + }, |
| 54 | + "additionalProperties": false |
| 55 | + } |
| 56 | + ] |
| 57 | + }, |
| 58 | + "guide": { |
| 59 | + "type": "string", |
| 60 | + "description": "Link to additional guide resources." |
| 61 | + }, |
| 62 | + "otherLink": { |
| 63 | + "type": "string", |
| 64 | + "description": "Link to a related resource or external page." |
| 65 | + }, |
| 66 | + "imgUrl": { |
| 67 | + "type": "string", |
| 68 | + "description": "URL of the thumbnail image." |
| 69 | + } |
| 70 | + }, |
| 71 | + "required": [ |
| 72 | + "caseTitle", |
| 73 | + "caseDesc", |
| 74 | + "tags", |
| 75 | + "github", |
| 76 | + "replit", |
| 77 | + "video", |
| 78 | + "guide", |
| 79 | + "otherLink", |
| 80 | + "imgUrl" |
| 81 | + ], |
| 82 | + "additionalProperties": false |
| 83 | + } |
14 | 84 | } |
0 commit comments