File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -121,10 +121,28 @@ class Convertor {
121121 }
122122 }
123123
124+ const defaultValuesForOfProperties = ( ) => {
125+ if ( schema . type === undefined && this . ofProperties . some ( element => Object . keys ( schema ) . includes ( element ) ) ) {
126+ if ( Object . keys ( schema ) . includes ( 'default' ) ) {
127+ for ( const property of this . ofProperties ) {
128+ if ( Object . keys ( schema ) . includes ( property ) ) {
129+ for ( const ofProperty of schema [ property ] ) {
130+ if ( ofProperty . type !== 'null' || ofProperty . nullable ) {
131+ ofProperty . default = schema . default
132+ delete schema . default
133+ }
134+ }
135+ }
136+ }
137+ }
138+ }
139+ }
140+
124141 convertNull ( )
125142 convertTypeArrays ( )
126143 bannedWordsRemoval ( )
127144 convertDefaultValues ( )
145+ defaultValuesForOfProperties ( )
128146
129147 if ( this . specialProperties . indexOf ( parentKeyword ) !== - 1 ) {
130148 if ( this . ofProperties . indexOf ( parentKeyword ) !== - 1 ) {
You can’t perform that action at this time.
0 commit comments