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

Add _opts property type in Ajv.Ajv #1262

Merged
merged 4 commits into from
Sep 15, 2020

Conversation

b4h0-c4t
Copy link
Contributor

What issue does this pull request resolve?
resolve #1253 issue.

What changes did you make?
Add type declaration Ajv.Ajv._opt

Is there anything that requires more attention while reviewing?
The reason why I set any type is other any object( ex. _metaOpts ) could not compatible with detailed objects.

Copy link
Member

@epoberezkin epoberezkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn’t it be the same interface as for Options?

@b4h0-c4t
Copy link
Contributor Author

b4h0-c4t commented Sep 7, 2020

@epoberezkin
Thanks for your review.
I think Options do not have some x._opts properties. (e.x. defaultMeta)

@b4h0-c4t
Copy link
Contributor Author

b4h0-c4t commented Sep 7, 2020

Self-resolved.
defaultMeta can translated meta.

@epoberezkin
Copy link
Member

I am thinking it may be best to wait a bit until v7 is released in a week or so...

@epoberezkin
Copy link
Member

It might be important to access this property though - defaultMeta is not the same as meta, so it should be added too.

Merging it.

@epoberezkin epoberezkin merged commit 877d286 into ajv-validator:master Sep 15, 2020
@b4h0-c4t b4h0-c4t deleted the refactor-opt-object-type branch October 6, 2020 08:42
@alasdairhurst
Copy link

@epoberezkin @b4h0-c4t is defaultMeta intended to be accessed exclusively via ajv._opts or is it available to be set in the constructor as part of the public API?

right now it's undocumented and i don't see any recommendation for using it other than from the old v5 docs, but it seems to work if you set it in the constructor as long as you add the relevant metaSchema straight afterwards. Maybe i'm missing something important though.

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

Successfully merging this pull request may close these issues.

using "_opt.defaultMeta" in TypeScript
3 participants