Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e.instancePath is undefined #2292

Closed
dvnrsn opened this issue Jun 14, 2023 · 2 comments
Closed

e.instancePath is undefined #2292

dvnrsn opened this issue Jun 14, 2023 · 2 comments

Comments

@dvnrsn
Copy link

dvnrsn commented Jun 14, 2023

const validate = ajv.compile(jsonSchema)
validate(value)
validate[0].instancePath

There is however a schemaPath and a dataPath

image

The TS shows an instancePath and schemaPath but no dataPath

export interface ErrorObject<K extends string = string, P = Record<string, any>, S = unknown> {
    keyword: K;
    instancePath: string;
    schemaPath: string;

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

"ajv": "^8.12.0",

Ajv options object

What results did you expect?

TS types to match the actual data

Are you going to resolve the issue?

Happy to but wanted to see if I'm doing something wrong

@epoberezkin
Copy link
Member

it looks like you have data from a previous ajv version - impossible to say without sample code to reproduce.

@jasoniangreen
Copy link
Collaborator

Closing as requested example code not provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants