File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ const _ = require('lodash');
77module . exports = function ( ) {
88
99 return function get ( swagger , parent ) {
10- if ( ! swagger . properties ) {
11- require ( '../utils/error.js' ) ( `There is an object without properties: ${ swagger } ` ) ;
12- }
10+
11+ validationProperties ( swagger ) ;
12+
1313 let notInclude = false ;
1414 if ( parent && global . requiredParamsCatch && _ . has ( swagger , 'required' ) ) {
1515 if ( ! global . configurationFile . minimal_endpoints ) {
@@ -43,4 +43,13 @@ module.exports = function() {
4343 return object ;
4444 } ;
4545
46+ function validationProperties ( swagger ) {
47+ if ( ! swagger . properties || Object . keys ( swagger . properties ) . length === 0 ) {
48+ if ( swagger . additionalProperties && swagger . additionalProperties !== false ) {
49+ return { }
50+ }
51+ require ( '../utils/error.js' ) ( `There is an object without properties: ${ JSON . stringify ( swagger ) } ` ) ;
52+ }
53+ }
54+
4655} ( )
You can’t perform that action at this time.
0 commit comments