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

fix #2427 compileAsync a schema with discriminator and $ref #2429

Closed

Conversation

yonran
Copy link
Contributor

@yonran yonran commented May 10, 2024

Make the discriminator code generation throw MissingRefError when the $ref does not synchronously resolve so that compileAsync can loadSchema and retry.

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 9, 2024 17:11
Make the discriminator code generation throw MissingRefError when the $ref does not synchronously resolve so that compileAsync can loadSchema and retry.
@jasoniangreen
Copy link
Collaborator

I've made some small changes just to get it passing linting and see how the tests run.

@jasoniangreen
Copy link
Collaborator

Not sure why coveralls is erroring. Will try a clean branch and see if I get the same issue.

@jasoniangreen
Copy link
Collaborator

This has been moved to #2433 due to coveralls issues.

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

2 participants