kristianmandrup/schema-to-yup

Multiple conditions for the same attribute

Closed this issue · 1 comments

Dear, I would like to know if it is possible to add multiple when for the same attribute, do you know if this is possible?

Example:

  const biggyJson = {
  title: "biggy",
  type: "object",
  properties: {
    isBig: {
      type: "boolean",
    },
     isShort: {
      type: "boolean",
    },
    count: {
      type: "number",
      when: {
        isBig: {
          is: true,
          then: {
            min: 5,
          },
        },
        isShort:{
         is: true,
         then:{
          min: 10,
        }
       }
      },
    },
  },
};

I think this would require using some of the customisation options included and documented. Not supported out of the box as far as I can recall.