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

using "_opt.defaultMeta" in TypeScript #1253

Closed
b4h0-c4t opened this issue Jul 27, 2020 · 2 comments · Fixed by #1262
Closed

using "_opt.defaultMeta" in TypeScript #1253

b4h0-c4t opened this issue Jul 27, 2020 · 2 comments · Fixed by #1262

Comments

@b4h0-c4t
Copy link
Contributor

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

Your typescript code

import metaSchema from 'ajv/lib/refs/json-schema-draft-04.json';

// create Ajv instance(ajv) and more code...
ajv._opts.defaultMeta = metaSchema.id;
...

Typescript compiler error messages

Property '_opts' does not exist on type 'Ajv'.

Describe the change that should be made to address the issue?
Add type definition for "_opt".
Please tell me If there are other solutions.

Are you going to resolve the issue?
I'll do this if a fix is ​​needed.

@b4h0-c4t
Copy link
Contributor Author

Proposed a simple solution.
I hope you can see this PR.

@b4h0-c4t
Copy link
Contributor Author

b4h0-c4t commented Oct 5, 2020

@epoberezkin
There's another problem with PR that solves this problem.
The purpose of the PR is to "access _opts.defaultMeta" but this solution doesn't do that.

Can I have another chance to fix this?

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

Successfully merging a pull request may close this issue.

1 participant