|
1 | 1 | { |
2 | | - "$schema": "http://json-schema.org/draft-04/schema#", |
| 2 | + "$schema": "http://json-schema.org/draft-07/schema#", |
3 | 3 | "allOf": [ |
4 | 4 | { |
5 | 5 | "anyOf": [ |
|
20 | 20 | "$ref": "#/definitions/defaultDestination" |
21 | 21 | } |
22 | 22 | ] |
| 23 | + }, |
| 24 | + { |
| 25 | + "if": { |
| 26 | + "$ref": "#/definitions/fileMapping" |
| 27 | + }, |
| 28 | + "then": { |
| 29 | + "$ref": "#/definitions/manifestVersion3" |
| 30 | + } |
23 | 31 | } |
24 | 32 | ], |
25 | 33 | "definitions": { |
26 | 34 | "libraryEntry": { |
27 | | - "required": ["library"], |
| 35 | + "required": [ "library" ], |
28 | 36 | "properties": { |
29 | 37 | "files": { |
30 | 38 | "description": "The file names of the individual files to copy to the project.", |
|
49 | 57 | "description": "The unique identifier of the provider", |
50 | 58 | "type": "string", |
51 | 59 | "minLength": 1 |
| 60 | + }, |
| 61 | + "fileMappings": { |
| 62 | + "description": "A list of file mappings.", |
| 63 | + "type": "array", |
| 64 | + "items": { |
| 65 | + "type": "object", |
| 66 | + "properties": { |
| 67 | + "root": { |
| 68 | + "description": "The mapping root within the library contents. If omitted, defaults to the library root.", |
| 69 | + "type": "string", |
| 70 | + "minLength": 1 |
| 71 | + }, |
| 72 | + "destination": { |
| 73 | + "description": "The destination for files included in this mapping. If omitted, defaults to a destination set for the library.", |
| 74 | + "type": "string", |
| 75 | + "minLength": 1 |
| 76 | + }, |
| 77 | + "files": { |
| 78 | + "description": "The file names of the individual files to copy to the project, relative to the specified root. If omitted, defaults to all files.", |
| 79 | + "type": "array", |
| 80 | + "default": null, |
| 81 | + "items": { |
| 82 | + "type": "string", |
| 83 | + "minLength": 1 |
| 84 | + } |
| 85 | + } |
| 86 | + } |
| 87 | + } |
52 | 88 | } |
53 | 89 | } |
54 | 90 | }, |
55 | 91 | "specifiedProvider": { |
56 | 92 | "properties": { |
57 | 93 | "libraries": { |
58 | 94 | "items": { |
59 | | - "required": ["provider"] |
| 95 | + "required": [ "provider" ] |
60 | 96 | } |
61 | 97 | } |
62 | 98 | }, |
63 | 99 | "not": { |
64 | | - "required": ["defaultProvider"] |
| 100 | + "required": [ "defaultProvider" ] |
65 | 101 | } |
66 | 102 | }, |
67 | 103 | "defaultProvider": { |
|
77 | 113 | "properties": { |
78 | 114 | "libraries": { |
79 | 115 | "items": { |
80 | | - "required": ["destination"] |
| 116 | + "required": [ "destination" ] |
81 | 117 | } |
82 | 118 | } |
83 | 119 | }, |
84 | 120 | "not": { |
85 | | - "required": ["defaultDestination"] |
| 121 | + "required": [ "defaultDestination" ] |
86 | 122 | } |
87 | 123 | }, |
88 | 124 | "defaultDestination": { |
|
93 | 129 | "minLength": 1 |
94 | 130 | } |
95 | 131 | } |
| 132 | + }, |
| 133 | + "fileMapping": { |
| 134 | + "properties": { |
| 135 | + "libraries": { |
| 136 | + "contains": { |
| 137 | + "required": [ "fileMappings" ] |
| 138 | + } |
| 139 | + } |
| 140 | + } |
| 141 | + }, |
| 142 | + "manifestVersion3": { |
| 143 | + "properties": { |
| 144 | + "version": { |
| 145 | + "const": "3.0" |
| 146 | + } |
| 147 | + }, |
| 148 | + "required": [ "version" ] |
96 | 149 | } |
97 | 150 | }, |
98 | 151 | "id": "https://json.schemastore.org/libman.json", |
|
105 | 158 | } |
106 | 159 | }, |
107 | 160 | "version": { |
108 | | - "description": "The syntax version of this config file. Can only be 1.0", |
109 | | - "enum": ["1.0"], |
110 | | - "default": "1.0" |
| 161 | + "description": "The syntax version of this config file.", |
| 162 | + "enum": [ "1.0", "3.0" ], |
| 163 | + "default": "3.0" |
111 | 164 | } |
112 | 165 | }, |
113 | | - "required": ["libraries"], |
| 166 | + "required": [ "libraries", "version" ], |
114 | 167 | "title": "JSON schema for client-side library config files", |
115 | 168 | "type": "object" |
116 | 169 | } |
0 commit comments