Skip to content

ajv-keywords does not work with JTD #357

@katicode2

Description

@katicode2

Description
I want to use the "transform"-keyword to perform a trim on certain string fields. But as soon as I want to add the ajv-keywords library and call addKeyword, I get the following error:

schema is invalid: data/type must NOT have additional properties, data must have property 'ref', data/type must be equal to one of the allowed values, data must have property 'enum', data must have property 'elements', data must have property 'properties', data must have property 'optionalProperties', data must have property 'discriminator', data must have property 'values', data must match a schema in union

Is there any documentation for this?

What version of Ajv are you using? Does the issue happen if you use the latest version?

8.11.2

Your code

import Ajv from 'ajv/dist/jtd';
import ajvKeywords from "ajv-keywords"

const ajv = new Ajv();
ajvKeywords(ajv, ["transform"]). // --> ERROR

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions