ajv-cli icon indicating copy to clipboard operation
ajv-cli copied to clipboard

Use AJV plugins with ajv-cli?

Open clenk opened this issue 4 years ago • 2 comments

Is there a way to specify AJV plugins for ajv-cli to use?

Specifically, I want to use https://github.com/luzlab/ajv-formats-draft2019 when running ajv compile to avoid errors about unknown format "idn-hostname" is used in schema at path.... Thanks.

clenk avatar Jun 29 '20 13:06 clenk

Yes, see -c option: https://github.com/ajv-validator/ajv-cli#-c---custom-keywordsformats-definitions

Probably readme needs to clarify that any plugin can be passed this way.

epoberezkin avatar Jun 29 '20 13:06 epoberezkin

I have the same problem, after updating to 4.0 formats are throwing an error:

error: unknown format "uuid" ignored in schema at path "#/items/properties/uuid"

Shouldn't the ajv-formats plugin be enabled by default? Because right now it means ajv-cli cannot validate a json schema out of the box according to the json schema spec.

danez avatar Jan 12 '21 16:01 danez