-
-
Notifications
You must be signed in to change notification settings - Fork 862
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
compileAsync a schema with discriminator and $ref, fixes #2427 #2433
Merged
+65
−1
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Make the discriminator code generation throw MissingRefError when the $ref does not synchronously resolve so that compileAsync can loadSchema and retry.
jasoniangreen
changed the title
fixes issue 2427 compileAsync a schema with discriminator and $ref
fix #2427 compileAsync a schema with discriminator and $ref
May 12, 2024
jasoniangreen
changed the title
fix #2427 compileAsync a schema with discriminator and $ref
compileAsync a schema with discriminator and $ref, fixes #2427
May 12, 2024
epoberezkin
approved these changes
May 16, 2024
kodiakhq bot
pushed a commit
to X-oss-byte/Canary-nextjs
that referenced
this pull request
May 26, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ajv](https://ajv.js.org) ([source](https://togithub.com/ajv-validator/ajv)) | [`8.13.0` -> `8.14.0`](https://renovatebot.com/diffs/npm/ajv/8.13.0/8.14.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/ajv/8.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/ajv/8.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/ajv/8.13.0/8.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/ajv/8.13.0/8.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>ajv-validator/ajv (ajv)</summary> ### [`v8.14.0`](https://togithub.com/ajv-validator/ajv/releases/tag/v8.14.0) [Compare Source](https://togithub.com/ajv-validator/ajv/compare/v8.13.0...v8.14.0) #### What's Changed - readme: build badge by [@​epoberezkin](https://togithub.com/epoberezkin) in [ajv-validator/ajv#2424 - Update workflows by [@​rotu](https://togithub.com/rotu) in [ajv-validator/ajv#2410 - docs: add warning to maxLength / minLength by [@​jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2428 - fix: broken link in docs warning by [@​jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2431 - compileAsync a schema with discriminator and $ref, fixes [#​2427](https://togithub.com/ajv-validator/ajv/issues/2427) by [@​jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2433 - bump version to 8.14.0 for publishing by [@​jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2440 #### New Contributors - [@​rotu](https://togithub.com/rotu) made their first contribution in [ajv-validator/ajv#2410 **Full Changelog**: ajv-validator/ajv@v8.13.0...v8.14.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/X-oss-byte/Canary-nextjs).
kodiakhq bot
pushed a commit
to X-oss-byte/Nextjs
that referenced
this pull request
May 26, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ajv](https://ajv.js.org) ([source](https://togithub.com/ajv-validator/ajv)) | [`8.13.0` -> `8.14.0`](https://renovatebot.com/diffs/npm/ajv/8.12.0/8.14.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/ajv/8.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/ajv/8.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/ajv/8.12.0/8.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/ajv/8.12.0/8.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>ajv-validator/ajv (ajv)</summary> ### [`v8.14.0`](https://togithub.com/ajv-validator/ajv/releases/tag/v8.14.0) [Compare Source](https://togithub.com/ajv-validator/ajv/compare/v8.13.0...v8.14.0) #### What's Changed - readme: build badge by [@​epoberezkin](https://togithub.com/epoberezkin) in [ajv-validator/ajv#2424 - Update workflows by [@​rotu](https://togithub.com/rotu) in [ajv-validator/ajv#2410 - docs: add warning to maxLength / minLength by [@​jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2428 - fix: broken link in docs warning by [@​jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2431 - compileAsync a schema with discriminator and $ref, fixes [#​2427](https://togithub.com/ajv-validator/ajv/issues/2427) by [@​jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2433 - bump version to 8.14.0 for publishing by [@​jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2440 #### New Contributors - [@​rotu](https://togithub.com/rotu) made their first contribution in [ajv-validator/ajv#2410 **Full Changelog**: ajv-validator/ajv@v8.13.0...v8.14.0 ### [`v8.13.0`](https://togithub.com/ajv-validator/ajv/releases/tag/v8.13.0) [Compare Source](https://togithub.com/ajv-validator/ajv/compare/v8.12.0...v8.13.0) - add named exports - update dependencies - update node.js </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/X-oss-byte/Nextjs).
fuxingloh
pushed a commit
to fuxingloh/karfia
that referenced
this pull request
May 26, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ajv](https://ajv.js.org) ([source](https://togithub.com/ajv-validator/ajv)) | [`^8.13.0` -> `^8.14.0`](https://renovatebot.com/diffs/npm/ajv/8.13.0/8.14.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/ajv/8.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/ajv/8.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/ajv/8.13.0/8.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/ajv/8.13.0/8.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>ajv-validator/ajv (ajv)</summary> ### [`v8.14.0`](https://togithub.com/ajv-validator/ajv/releases/tag/v8.14.0) [Compare Source](https://togithub.com/ajv-validator/ajv/compare/v8.13.0...v8.14.0) #### What's Changed - readme: build badge by [@​epoberezkin](https://togithub.com/epoberezkin) in [ajv-validator/ajv#2424 - Update workflows by [@​rotu](https://togithub.com/rotu) in [ajv-validator/ajv#2410 - docs: add warning to maxLength / minLength by [@​jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2428 - fix: broken link in docs warning by [@​jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2431 - compileAsync a schema with discriminator and $ref, fixes [#​2427](https://togithub.com/ajv-validator/ajv/issues/2427) by [@​jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2433 - bump version to 8.14.0 for publishing by [@​jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2440 #### New Contributors - [@​rotu](https://togithub.com/rotu) made their first contribution in [ajv-validator/ajv#2410 **Full Changelog**: ajv-validator/ajv@v8.13.0...v8.14.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/fuxingloh/karfia). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNjguMTAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4zNjguMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
fuxingloh
pushed a commit
to fuxingloh/crypto-frontmatter
that referenced
this pull request
May 26, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ajv](https://ajv.js.org) ([source](https://togithub.com/ajv-validator/ajv)) | [`^8.13.0` -> `^8.14.0`](https://renovatebot.com/diffs/npm/ajv/8.13.0/8.14.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/ajv/8.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/ajv/8.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/ajv/8.13.0/8.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/ajv/8.13.0/8.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>ajv-validator/ajv (ajv)</summary> ### [`v8.14.0`](https://togithub.com/ajv-validator/ajv/releases/tag/v8.14.0) [Compare Source](https://togithub.com/ajv-validator/ajv/compare/v8.13.0...v8.14.0) #### What's Changed - readme: build badge by [@​epoberezkin](https://togithub.com/epoberezkin) in [ajv-validator/ajv#2424 - Update workflows by [@​rotu](https://togithub.com/rotu) in [ajv-validator/ajv#2410 - docs: add warning to maxLength / minLength by [@​jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2428 - fix: broken link in docs warning by [@​jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2431 - compileAsync a schema with discriminator and $ref, fixes [#​2427](https://togithub.com/ajv-validator/ajv/issues/2427) by [@​jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2433 - bump version to 8.14.0 for publishing by [@​jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2440 #### New Contributors - [@​rotu](https://togithub.com/rotu) made their first contribution in [ajv-validator/ajv#2410 **Full Changelog**: ajv-validator/ajv@v8.13.0...v8.14.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/fuxingloh/crypto-frontmatter). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNjguMTAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4zNjguMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Originally by @yonran - I had to start a fresh PR and cherry-pick due to some unknown coveralls error on his PR. Description taken from original.
What issue does this pull request resolve?
#2427
What changes did you make?
Make the discriminator code generation throw MissingRefError when the $ref does not synchronously resolve so that compileAsync can loadSchema and retry.
Is there anything that requires more attention while reviewing?
The existing tests create separate test Ajv instances by calling withStandalone(getAjvInstances(AjvClass, …)) (https://github.com/ajv-validator/ajv/blob/v8.13.0/spec/discriminator.spec.ts#L22). I could not directly reuse those Ajv instances because I need to add the loadSchema option and I can’t call compileAsync on an Ajv after withStandalone. For now I only called new _Ajv. To what extent should I try creating separate ajv, ajv2019, standalone instances in the test?