Skip to content

object required bug #110

@ozt88

Description

@ozt88
const schema = new Schema({
  number: {
    type: Number,
    required: true,
  },
  parent: {
    type: Object,
    required: false,
    properties: {
      child: {
        type: Number,
        required: true,
      }
    }
  }
});
const err = schema.validate({
  number: 1
});
console.log(err);
/// parent.child is required
should.not.exist(err);

not required parent which have a child required

I expect this parent could be undefined but not

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions