Skip to content

Commit

Permalink
Merge pull request #273 from hyperledger-labs/additional-props-in-config
Browse files Browse the repository at this point in the history
Allow additional properties in Fablo config
  • Loading branch information
Jakub Dzikowski authored Jan 5, 2022
2 parents 5dfec18 + 120a52a commit 31f59fa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 43 deletions.
42 changes: 14 additions & 28 deletions docs/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@
],
"default": "info"
}
},
"additionalProperties": false
}
},
"tools": {
"$id": "#/properties/global/properties/tools",
Expand All @@ -100,8 +99,7 @@
}
}
}
},
"additionalProperties": false
}
},
"orgs": {
"$id": "#/properties/orgs",
Expand Down Expand Up @@ -174,8 +172,7 @@
"type": "string",
"pattern": "^[a-z0-9\\.\\-]+$"
}
},
"additionalProperties": false
}
},
"ca": {
"$id": "#/properties/orgs/items/properties/ca",
Expand All @@ -198,8 +195,7 @@
"postgres"
]
}
},
"additionalProperties": false
}
},
"orderers": {
"$id": "#/properties/orgs/items/properties/orderers",
Expand Down Expand Up @@ -252,8 +248,7 @@
"minimum": 1,
"maximum": 9
}
},
"additionalProperties": false
}
}
},
"peer": {
Expand Down Expand Up @@ -293,8 +288,7 @@
"CouchDb"
]
}
},
"additionalProperties": false
}
},
"tools": {
"$id": "#/properties/orgs/items/properties/tools",
Expand All @@ -312,11 +306,9 @@
"title": "Blockchain Explorer enabled",
"type": "boolean"
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
}
},
"channels": {
Expand Down Expand Up @@ -408,12 +400,10 @@
"pattern": "^[a-z0-9]+$"
}
}
},
"additionalProperties": false
}
}
}
},
"additionalProperties": false
}
}
},
"chaincodes": {
Expand Down Expand Up @@ -541,12 +531,10 @@
]
}
}
},
"additionalProperties": false
}
}
}
},
"additionalProperties": false
}
}
},
"hooks": {
Expand All @@ -561,9 +549,7 @@
"description": "Operation to run run after a network config is generated",
"type": "string"
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
}
14 changes: 0 additions & 14 deletions e2e/__snapshots__/schema.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ exports[`schema should match snapshot 1`] = `
Object {
"$id": "http://example.com/example.json",
"$schema": "http://json-schema.org/draft-07/schema",
"additionalProperties": false,
"default": Object {},
"properties": Object {
"$schema": Object {
Expand All @@ -25,7 +24,6 @@ Object {
],
"items": Object {
"$id": "#/properties/chaincodes/items",
"additionalProperties": false,
"properties": Object {
"channel": Object {
"$id": "#/properties/chaincodes/items/properties/channel",
Expand Down Expand Up @@ -83,7 +81,6 @@ Object {
"$id": "#/properties/chaincodes/items/properties/privateData",
"items": Object {
"$id": "#/properties/chaincodes/items/properties/privateData/items",
"additionalProperties": false,
"properties": Object {
"name": Object {
"$id": "#/properties/chaincodes/items/properties/privateData/items/properties/name",
Expand Down Expand Up @@ -171,7 +168,6 @@ Object {
],
"items": Object {
"$id": "#/properties/channels/items",
"additionalProperties": false,
"properties": Object {
"name": Object {
"$id": "#/properties/channels/items/properties/name",
Expand All @@ -189,7 +185,6 @@ Object {
"$id": "#/properties/channels/items/properties/orgs",
"items": Object {
"$id": "#/properties/channels/items/properties/orgs/items",
"additionalProperties": false,
"properties": Object {
"name": Object {
"$id": "#/properties/channels/items/properties/orgs/items/properties/name",
Expand Down Expand Up @@ -242,7 +237,6 @@ Object {
},
"global": Object {
"$id": "#/properties/global",
"additionalProperties": false,
"description": "Basic settings of the Hyperledger Fabric network",
"properties": Object {
"fabricVersion": Object {
Expand Down Expand Up @@ -283,7 +277,6 @@ Object {
},
"monitoring": Object {
"$id": "#/properties/monitoring",
"additionalProperties": false,
"description": "Optional settings for monitoring purposes",
"properties": Object {
"loglevel": Object {
Expand Down Expand Up @@ -331,7 +324,6 @@ Object {
},
"hooks": Object {
"$id": "#/properties/hooks",
"additionalProperties": false,
"description": "Operations (bash scripts or commands) that should be executed after specific events. The PWD for the Hooks is set to 'fablo-target' directory",
"properties": Object {
"postGenerate": Object {
Expand Down Expand Up @@ -380,11 +372,9 @@ Object {
],
"items": Object {
"$id": "#/properties/orgs/items",
"additionalProperties": false,
"properties": Object {
"ca": Object {
"$id": "#/properties/orgs/items/properties/ca",
"additionalProperties": false,
"properties": Object {
"db": Object {
"$id": "#/properties/orgs/items/properties/ca/properties/db",
Expand Down Expand Up @@ -418,7 +408,6 @@ Object {
],
"items": Object {
"$id": "#/properties/orgs/items/properties/orderers/items",
"additionalProperties": false,
"properties": Object {
"groupName": Object {
"$id": "#/properties/orgs/items/properties/orderers/items/properties/groupName",
Expand Down Expand Up @@ -463,7 +452,6 @@ Object {
},
"organization": Object {
"$id": "#/properties/orgs/items/properties/organization",
"additionalProperties": false,
"properties": Object {
"domain": Object {
"$id": "#/properties/orgs/items/properties/organization/properties/domain",
Expand Down Expand Up @@ -493,7 +481,6 @@ Object {
},
"peer": Object {
"$id": "#/properties/orgs/items/properties/peer",
"additionalProperties": false,
"properties": Object {
"anchorPeerInstances": Object {
"$id": "#/properties/orgs/items/properties/peer/properties/anchorPeerInstances",
Expand Down Expand Up @@ -533,7 +520,6 @@ Object {
},
"tools": Object {
"$id": "#/properties/orgs/items/properties/tools",
"additionalProperties": false,
"properties": Object {
"explorer": Object {
"$id": "#/properties/orgs/items/properties/tools/properties/explorer",
Expand Down
1 change: 0 additions & 1 deletion e2e/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ describe("schema", () => {
expect(withTools({ fabloRest: true })).toMatchSchema(schema);
expect(withTools({ fabloRest: false })).toMatchSchema(schema);
expect(withTools({})).toMatchSchema(schema);
expect(withTools({ unknown: true })).not.toMatchSchema(schema);
});

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

0 comments on commit 31f59fa

Please sign in to comment.