Skip to content

Commit

Permalink
Updated validator to make label optional when there's only one uiEntr…
Browse files Browse the repository at this point in the history
…yPoint.
  • Loading branch information
ashryanbeats committed Nov 5, 2019
1 parent 514a602 commit ffd634b
Showing 1 changed file with 59 additions and 24 deletions.
83 changes: 59 additions & 24 deletions lib/manifestSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,34 +55,69 @@ const manifestScema = {
}
},
uiEntryPoints: {
type: "array",
minItems: 1,
uniqueItems: true,
items: {
required: ["type", "label"],
properties: {
type: {
type: "string",
enum: ["menu", "panel"]
},
label: {
type: ["string", "object"]
},
commandId: {
type: "string"
},
panelId: {
type: "string"
},
shortcut: {
type: "object",
oneOf: [
{
type: "array",
minItems: 1,
maxItems: 1,
uniqueItems: true,
items: {
required: ["type"],
properties: {
mac: { type: "string" },
win: { type: "string" }
type: {
type: "string",
enum: ["menu", "panel"]
},
label: {
type: ["string", "object"]
},
commandId: {
type: "string"
},
panelId: {
type: "string"
},
shortcut: {
type: "object",
properties: {
mac: { type: "string" },
win: { type: "string" }
}
}
}
}
},
{
type: "array",
minItems: 2,
uniqueItems: true,
items: {
required: ["type", "label"],
properties: {
type: {
type: "string",
enum: ["menu", "panel"]
},
label: {
type: ["string", "object"]
},
commandId: {
type: "string"
},
panelId: {
type: "string"
},
shortcut: {
type: "object",
properties: {
mac: { type: "string" },
win: { type: "string" }
}
}
}
}
}
}
]
}
}
};
Expand Down

0 comments on commit ffd634b

Please sign in to comment.