File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,11 @@ async function run() {
69
69
return obj ;
70
70
} ;
71
71
72
+ function addActionToRequired ( schema ) {
73
+ if ( schema . properties . action !== undefined ) {
74
+ schema . required . push ( "action" ) ;
75
+ }
76
+ }
72
77
const webhooks = schema . webhooks ;
73
78
for ( const webhookId in webhooks ) {
74
79
const webhook = webhooks [ webhookId ] . post ;
@@ -89,6 +94,13 @@ async function run() {
89
94
tempSchema . components . schemas [ refName ] =
90
95
schema . components . schemas [ refName ] ;
91
96
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
+ }
92
104
if ( typeof examples !== "undefined" ) {
93
105
for ( let key of Object . keys ( examples ) ) {
94
106
const example$ref = examples [ key ] . $ref . split ( "/" ) . at ( - 1 ) ;
You can’t perform that action at this time.
0 commit comments