Skip to content

Commit fb0d2b7

Browse files
committed
fix: mark action properties as required
1 parent b33c7ef commit fb0d2b7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

scripts/build.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ async function run() {
6969
return obj;
7070
};
7171

72+
function addActionToRequired(schema) {
73+
if (schema.properties.action !== undefined) {
74+
schema.required.push("action");
75+
}
76+
}
7277
const webhooks = schema.webhooks;
7378
for (const webhookId in webhooks) {
7479
const webhook = webhooks[webhookId].post;
@@ -89,6 +94,13 @@ async function run() {
8994
tempSchema.components.schemas[refName] =
9095
schema.components.schemas[refName];
9196
specialHandling(schema.components.schemas[refName]);
97+
if (tempSchema.components.schemas[refName].oneOf !== undefined) {
98+
for (let oneOf of tempSchema.components.schemas[refName].oneOf) {
99+
addActionToRequired(oneOf);
100+
}
101+
} else {
102+
addActionToRequired(tempSchema.components.schemas[refName]);
103+
}
92104
if (typeof examples !== "undefined") {
93105
for (let key of Object.keys(examples)) {
94106
const example$ref = examples[key].$ref.split("/").at(-1);

0 commit comments

Comments
 (0)