-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathfix-schema.js
38 lines (32 loc) · 870 Bytes
/
fix-schema.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const fs = require("fs")
const path = require("path")
const schemaFile = path.join(__dirname, "../packages/app-builder-lib/scheme.json")
const schema = JSON.parse(fs.readFileSync(schemaFile, "utf-8"))
let o = schema.definitions.PlugDescriptor.additionalProperties.anyOf[0]
delete o.typeof
o.type = "object"
schema.definitions.OutgoingHttpHeaders.additionalProperties = {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": [
"string",
"number"
]
}
]
}
o = schema.definitions.SnapOptions.properties.environment.anyOf[0] = {
additionalProperties: { type: "string" },
type: "object",
}
o = schema.properties["$schema"] = {
"description": "JSON Schema for this document.",
"type": ["null", "string"],
}
fs.writeFileSync(schemaFile, JSON.stringify(schema, null, 2))