chris48s / v8r

✔️ A command-line JSON, YAML and TOML validator that's on your wavelength
https://chris48s.github.io/v8r/
MIT License
28 stars 5 forks source link

how to enable allowUnionTypes? #387

Open Sam-Lin-MillersLab opened 9 months ago

Sam-Lin-MillersLab commented 9 months ago

I got error like

  strict mode: use allowUnionTypes to allow union type keyword at "https://json.schemastore.org/appsettings.json#" (strictTypes)

thanks!

chris48s commented 8 months ago

allowUnionTypes is an ajv option. At the moment, v8r doesn't allow any way to pass options through to ajv, so there isn't a way to enable it.

Ajv has quite a lot of options: https://ajv.js.org/options.html

I'm a bit on the fence about how (or whether) to handle allowing the user to pass through configuration options to ajv :thinking: Feels like quite a big topic to rush into, but I'll have a think.

Sam-Lin-MillersLab commented 8 months ago

I think it will be awesome to have a way to pass thru options. Thanks!

chris48s commented 7 months ago

I know it has been quite a long time since this issue was posted, but I have been thinking about it again today. Are you able to provide an example of a schema that outputs this?