forked from tsai/budibase
3 changed files with 8 additions and 11 deletions
@ -1,8 +1,11 @@ |
|||||
exports.object = (props, opts) => { |
exports.object = (props, opts) => { |
||||
return { |
const base = { |
||||
type: "object", |
type: "object", |
||||
properties: props, |
properties: props, |
||||
required: Object.keys(props), |
|
||||
...opts, |
...opts, |
||||
} |
} |
||||
|
if (Object.keys(props).length > 0 && (!opts || !opts.required)) { |
||||
|
base.required = Object.keys(props) |
||||
|
} |
||||
|
return base |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue