Skip to content

Commit 31f59fa

Browse files
author
Jakub Dzikowski
authored
Merge pull request #273 from hyperledger-labs/additional-props-in-config
Allow additional properties in Fablo config
2 parents 5dfec18 + 120a52a commit 31f59fa

File tree

3 files changed

+14
-43
lines changed

3 files changed

+14
-43
lines changed

docs/schema.json

+14-28
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@
8484
],
8585
"default": "info"
8686
}
87-
},
88-
"additionalProperties": false
87+
}
8988
},
9089
"tools": {
9190
"$id": "#/properties/global/properties/tools",
@@ -100,8 +99,7 @@
10099
}
101100
}
102101
}
103-
},
104-
"additionalProperties": false
102+
}
105103
},
106104
"orgs": {
107105
"$id": "#/properties/orgs",
@@ -174,8 +172,7 @@
174172
"type": "string",
175173
"pattern": "^[a-z0-9\\.\\-]+$"
176174
}
177-
},
178-
"additionalProperties": false
175+
}
179176
},
180177
"ca": {
181178
"$id": "#/properties/orgs/items/properties/ca",
@@ -198,8 +195,7 @@
198195
"postgres"
199196
]
200197
}
201-
},
202-
"additionalProperties": false
198+
}
203199
},
204200
"orderers": {
205201
"$id": "#/properties/orgs/items/properties/orderers",
@@ -252,8 +248,7 @@
252248
"minimum": 1,
253249
"maximum": 9
254250
}
255-
},
256-
"additionalProperties": false
251+
}
257252
}
258253
},
259254
"peer": {
@@ -293,8 +288,7 @@
293288
"CouchDb"
294289
]
295290
}
296-
},
297-
"additionalProperties": false
291+
}
298292
},
299293
"tools": {
300294
"$id": "#/properties/orgs/items/properties/tools",
@@ -312,11 +306,9 @@
312306
"title": "Blockchain Explorer enabled",
313307
"type": "boolean"
314308
}
315-
},
316-
"additionalProperties": false
309+
}
317310
}
318-
},
319-
"additionalProperties": false
311+
}
320312
}
321313
},
322314
"channels": {
@@ -408,12 +400,10 @@
408400
"pattern": "^[a-z0-9]+$"
409401
}
410402
}
411-
},
412-
"additionalProperties": false
403+
}
413404
}
414405
}
415-
},
416-
"additionalProperties": false
406+
}
417407
}
418408
},
419409
"chaincodes": {
@@ -541,12 +531,10 @@
541531
]
542532
}
543533
}
544-
},
545-
"additionalProperties": false
534+
}
546535
}
547536
}
548-
},
549-
"additionalProperties": false
537+
}
550538
}
551539
},
552540
"hooks": {
@@ -561,9 +549,7 @@
561549
"description": "Operation to run run after a network config is generated",
562550
"type": "string"
563551
}
564-
},
565-
"additionalProperties": false
552+
}
566553
}
567-
},
568-
"additionalProperties": false
554+
}
569555
}

e2e/__snapshots__/schema.test.ts.snap

-14
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ exports[`schema should match snapshot 1`] = `
44
Object {
55
"$id": "http://example.com/example.json",
66
"$schema": "http://json-schema.org/draft-07/schema",
7-
"additionalProperties": false,
87
"default": Object {},
98
"properties": Object {
109
"$schema": Object {
@@ -25,7 +24,6 @@ Object {
2524
],
2625
"items": Object {
2726
"$id": "#/properties/chaincodes/items",
28-
"additionalProperties": false,
2927
"properties": Object {
3028
"channel": Object {
3129
"$id": "#/properties/chaincodes/items/properties/channel",
@@ -83,7 +81,6 @@ Object {
8381
"$id": "#/properties/chaincodes/items/properties/privateData",
8482
"items": Object {
8583
"$id": "#/properties/chaincodes/items/properties/privateData/items",
86-
"additionalProperties": false,
8784
"properties": Object {
8885
"name": Object {
8986
"$id": "#/properties/chaincodes/items/properties/privateData/items/properties/name",
@@ -171,7 +168,6 @@ Object {
171168
],
172169
"items": Object {
173170
"$id": "#/properties/channels/items",
174-
"additionalProperties": false,
175171
"properties": Object {
176172
"name": Object {
177173
"$id": "#/properties/channels/items/properties/name",
@@ -189,7 +185,6 @@ Object {
189185
"$id": "#/properties/channels/items/properties/orgs",
190186
"items": Object {
191187
"$id": "#/properties/channels/items/properties/orgs/items",
192-
"additionalProperties": false,
193188
"properties": Object {
194189
"name": Object {
195190
"$id": "#/properties/channels/items/properties/orgs/items/properties/name",
@@ -242,7 +237,6 @@ Object {
242237
},
243238
"global": Object {
244239
"$id": "#/properties/global",
245-
"additionalProperties": false,
246240
"description": "Basic settings of the Hyperledger Fabric network",
247241
"properties": Object {
248242
"fabricVersion": Object {
@@ -283,7 +277,6 @@ Object {
283277
},
284278
"monitoring": Object {
285279
"$id": "#/properties/monitoring",
286-
"additionalProperties": false,
287280
"description": "Optional settings for monitoring purposes",
288281
"properties": Object {
289282
"loglevel": Object {
@@ -331,7 +324,6 @@ Object {
331324
},
332325
"hooks": Object {
333326
"$id": "#/properties/hooks",
334-
"additionalProperties": false,
335327
"description": "Operations (bash scripts or commands) that should be executed after specific events. The PWD for the Hooks is set to 'fablo-target' directory",
336328
"properties": Object {
337329
"postGenerate": Object {
@@ -380,11 +372,9 @@ Object {
380372
],
381373
"items": Object {
382374
"$id": "#/properties/orgs/items",
383-
"additionalProperties": false,
384375
"properties": Object {
385376
"ca": Object {
386377
"$id": "#/properties/orgs/items/properties/ca",
387-
"additionalProperties": false,
388378
"properties": Object {
389379
"db": Object {
390380
"$id": "#/properties/orgs/items/properties/ca/properties/db",
@@ -418,7 +408,6 @@ Object {
418408
],
419409
"items": Object {
420410
"$id": "#/properties/orgs/items/properties/orderers/items",
421-
"additionalProperties": false,
422411
"properties": Object {
423412
"groupName": Object {
424413
"$id": "#/properties/orgs/items/properties/orderers/items/properties/groupName",
@@ -463,7 +452,6 @@ Object {
463452
},
464453
"organization": Object {
465454
"$id": "#/properties/orgs/items/properties/organization",
466-
"additionalProperties": false,
467455
"properties": Object {
468456
"domain": Object {
469457
"$id": "#/properties/orgs/items/properties/organization/properties/domain",
@@ -493,7 +481,6 @@ Object {
493481
},
494482
"peer": Object {
495483
"$id": "#/properties/orgs/items/properties/peer",
496-
"additionalProperties": false,
497484
"properties": Object {
498485
"anchorPeerInstances": Object {
499486
"$id": "#/properties/orgs/items/properties/peer/properties/anchorPeerInstances",
@@ -533,7 +520,6 @@ Object {
533520
},
534521
"tools": Object {
535522
"$id": "#/properties/orgs/items/properties/tools",
536-
"additionalProperties": false,
537523
"properties": Object {
538524
"explorer": Object {
539525
"$id": "#/properties/orgs/items/properties/tools/properties/explorer",

e2e/schema.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ describe("schema", () => {
186186
expect(withTools({ fabloRest: true })).toMatchSchema(schema);
187187
expect(withTools({ fabloRest: false })).toMatchSchema(schema);
188188
expect(withTools({})).toMatchSchema(schema);
189-
expect(withTools({ unknown: true })).not.toMatchSchema(schema);
190189
});
191190

192191
it("should validate channel name - no spaces and capital letters", () => {

0 commit comments

Comments
 (0)