File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
packages/cli/generators/model Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -302,10 +302,20 @@ module.exports = class ModelGenerator extends ArtifactGenerator {
302302 ] )
303303 . then ( setting => {
304304 Object . assign ( this . artifactInfo , setting ) ;
305-
306305 if ( this . artifactInfo . allowAdditionalProperties ) {
307306 Object . assign ( this . artifactInfo . modelSettings , { strict : false } ) ;
308307 }
308+
309+ const dsType = this . artifactInfo . dataSourceType ;
310+ if ( ! this . artifactInfo . modelSettings )
311+ this . artifactInfo . modelSettings = { } ;
312+ if ( dsType === 'relational' ) {
313+ this . artifactInfo . allowAdditionalProperties = false ;
314+ this . artifactInfo . modelSettings . strict = true ;
315+ } else {
316+ this . artifactInfo . allowAdditionalProperties = true ;
317+ this . artifactInfo . modelSettings . strict = false ;
318+ }
309319 // inform user what model/file names will be created
310320 super . promptClassFileName (
311321 'model' ,
You can’t perform that action at this time.
0 commit comments