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

compileAsync a schema with discriminator and $ref, fixes #2427 #2433

Merged
merged 2 commits into from May 17, 2024

Conversation

jasoniangreen
Copy link
Collaborator

@jasoniangreen jasoniangreen commented May 12, 2024

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?

yonran and others added 2 commits May 12, 2024 22:14
Make the discriminator code generation throw MissingRefError when the $ref does not synchronously resolve so that compileAsync can loadSchema and retry.
@jasoniangreen 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 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
@jasoniangreen jasoniangreen merged commit 5f20d5f into master May 17, 2024
5 checks passed
@jasoniangreen jasoniangreen deleted the fix-issue-2427-discriminator branch May 17, 2024 17:36
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 [@&#8203;epoberezkin](https://togithub.com/epoberezkin) in [ajv-validator/ajv#2424
-   Update workflows by [@&#8203;rotu](https://togithub.com/rotu) in [ajv-validator/ajv#2410
-   docs: add warning to maxLength / minLength by [@&#8203;jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2428
-   fix: broken link in docs warning by [@&#8203;jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2431
-   compileAsync a schema with discriminator and $ref, fixes [#&#8203;2427](https://togithub.com/ajv-validator/ajv/issues/2427)  by [@&#8203;jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2433
-   bump version to 8.14.0 for publishing by [@&#8203;jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2440

#### New Contributors

-   [@&#8203;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 [@&#8203;epoberezkin](https://togithub.com/epoberezkin) in [ajv-validator/ajv#2424
-   Update workflows by [@&#8203;rotu](https://togithub.com/rotu) in [ajv-validator/ajv#2410
-   docs: add warning to maxLength / minLength by [@&#8203;jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2428
-   fix: broken link in docs warning by [@&#8203;jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2431
-   compileAsync a schema with discriminator and $ref, fixes [#&#8203;2427](https://togithub.com/ajv-validator/ajv/issues/2427)  by [@&#8203;jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2433
-   bump version to 8.14.0 for publishing by [@&#8203;jasoniangreen](https://togithub.com/jasoniangreen) in [ajv-validator/ajv#2440

#### New Contributors

-   [@&#8203;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
[@&#8203;epoberezkin](https://togithub.com/epoberezkin) in
[ajv-validator/ajv#2424
- Update workflows by [@&#8203;rotu](https://togithub.com/rotu) in
[ajv-validator/ajv#2410
- docs: add warning to maxLength / minLength by
[@&#8203;jasoniangreen](https://togithub.com/jasoniangreen) in
[ajv-validator/ajv#2428
- fix: broken link in docs warning by
[@&#8203;jasoniangreen](https://togithub.com/jasoniangreen) in
[ajv-validator/ajv#2431
- compileAsync a schema with discriminator and $ref, fixes
[#&#8203;2427](https://togithub.com/ajv-validator/ajv/issues/2427) by
[@&#8203;jasoniangreen](https://togithub.com/jasoniangreen) in
[ajv-validator/ajv#2433
- bump version to 8.14.0 for publishing by
[@&#8203;jasoniangreen](https://togithub.com/jasoniangreen) in
[ajv-validator/ajv#2440

#### New Contributors

- [@&#8203;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
[@&#8203;epoberezkin](https://togithub.com/epoberezkin) in
[ajv-validator/ajv#2424
- Update workflows by [@&#8203;rotu](https://togithub.com/rotu) in
[ajv-validator/ajv#2410
- docs: add warning to maxLength / minLength by
[@&#8203;jasoniangreen](https://togithub.com/jasoniangreen) in
[ajv-validator/ajv#2428
- fix: broken link in docs warning by
[@&#8203;jasoniangreen](https://togithub.com/jasoniangreen) in
[ajv-validator/ajv#2431
- compileAsync a schema with discriminator and $ref, fixes
[#&#8203;2427](https://togithub.com/ajv-validator/ajv/issues/2427) by
[@&#8203;jasoniangreen](https://togithub.com/jasoniangreen) in
[ajv-validator/ajv#2433
- bump version to 8.14.0 for publishing by
[@&#8203;jasoniangreen](https://togithub.com/jasoniangreen) in
[ajv-validator/ajv#2440

#### New Contributors

- [@&#8203;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
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants