electron-store icon indicating copy to clipboard operation
electron-store copied to clipboard

Warning about not allowing union types

Open mtdvlpr opened this issue 3 years ago • 0 comments

Warning: strict mode: use allowUnionTypes to allow union type keyword at "#/properties/***/properties/***" (strictTypes)

Hi, I'm getting above warning, because I set one of my properties to be either string or number. This warning can be traced back to the ajv package you use to validate the JSON schema. I would like the warning to be solved. Or is it against your wishes to allow the electron store to handle union types?

mtdvlpr avatar Aug 04 '22 06:08 mtdvlpr

Did you read https://ajv.js.org/strict-mode.html#union-types?

It seems it's preferable to use anyOf.

sindresorhus avatar Aug 25 '22 04:08 sindresorhus

I have not, thanks!

mtdvlpr avatar Aug 25 '22 05:08 mtdvlpr