|
1 | 1 | const azionConfigSchema = {
|
2 | 2 | type: 'object',
|
3 | 3 | properties: {
|
| 4 | + origin: { |
| 5 | + type: 'array', |
| 6 | + items: { |
| 7 | + type: 'object', |
| 8 | + properties: { |
| 9 | + name: { |
| 10 | + type: 'string', |
| 11 | + errorMessage: "The 'name' field must be a string.", |
| 12 | + }, |
| 13 | + type: { |
| 14 | + type: 'string', |
| 15 | + errorMessage: "The 'type' field must be a string.", |
| 16 | + }, |
| 17 | + bucket: { |
| 18 | + type: ['string', 'null'], |
| 19 | + errorMessage: "The 'bucket' field must be a string or null.", |
| 20 | + }, |
| 21 | + prefix: { |
| 22 | + type: ['string', 'null'], |
| 23 | + errorMessage: "The 'prefix' field must be a string or null.", |
| 24 | + }, |
| 25 | + addresses: { |
| 26 | + type: 'array', |
| 27 | + items: { |
| 28 | + type: 'string', |
| 29 | + errorMessage: "The 'address' field must be a string.", |
| 30 | + }, |
| 31 | + }, |
| 32 | + hostHeader: { |
| 33 | + type: 'string', |
| 34 | + errorMessage: "The 'hostHeader' field must be a string.", |
| 35 | + }, |
| 36 | + }, |
| 37 | + required: ['name', 'type'], |
| 38 | + additionalProperties: false, |
| 39 | + errorMessage: { |
| 40 | + additionalProperties: |
| 41 | + 'No additional properties are allowed in origin item objects.', |
| 42 | + required: |
| 43 | + "The 'name and type' field is required in each origin item.", |
| 44 | + }, |
| 45 | + }, |
| 46 | + errorMessage: { |
| 47 | + additionalProperties: "The 'origin' field must be an array of objects.", |
| 48 | + }, |
| 49 | + }, |
4 | 50 | cache: {
|
5 | 51 | type: 'array',
|
6 | 52 | items: {
|
@@ -132,24 +178,14 @@ const azionConfigSchema = {
|
132 | 178 | type: 'string',
|
133 | 179 | errorMessage: "The 'type' field must be a string.",
|
134 | 180 | },
|
135 |
| - bucket: { |
136 |
| - type: ['string', 'null'], |
137 |
| - errorMessage: |
138 |
| - "The 'bucket' field must be a string or null.", |
139 |
| - }, |
140 |
| - prefix: { |
141 |
| - type: ['string', 'null'], |
142 |
| - errorMessage: |
143 |
| - "The 'prefix' field must be a string or null.", |
144 |
| - }, |
145 | 181 | },
|
146 |
| - required: ['type'], |
| 182 | + required: ['name', 'type'], |
147 | 183 | additionalProperties: false,
|
148 | 184 | errorMessage: {
|
149 | 185 | additionalProperties:
|
150 | 186 | "No additional properties are allowed in the 'setOrigin' object.",
|
151 | 187 | required:
|
152 |
| - "The 'type' field is required in the 'setOrigin' object.", |
| 188 | + "The 'name or type' field is required in the 'setOrigin' object.", |
153 | 189 | },
|
154 | 190 | },
|
155 | 191 | rewrite: {
|
|
0 commit comments