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

Upgrade Ajv dependency to v8 #58

Closed
4 tasks done
simonplend opened this issue Jan 19, 2021 · 4 comments · Fixed by #97
Closed
4 tasks done

Upgrade Ajv dependency to v8 #58

simonplend opened this issue Jan 19, 2021 · 4 comments · Fixed by #97

Comments

@simonplend
Copy link
Owner

simonplend commented Jan 19, 2021

This library is currently using Ajv v6. Upgrading to Ajv v7 was proposed in pull request #55. In the meantime, Ajv v8 has been released, so we'll upgrade to that.

See: Changes from Ajv v6.12.6 to v8.0.0

TODO

Some of these may be worth breaking out into separate issues.

  • Upgrade Ajv dependency to latest release (v8.8.2)
    • Run tests
    • Install in test application and test manually
  • Identify breaking changes between Ajv v6 and v8 which directly affect this library (none)
@simonplend simonplend added this to the Release v3.0.0 milestone Jan 19, 2021
@jledentu
Copy link

jledentu commented Apr 1, 2021

Hi, Ajv v8 has been released on March 27. Do you plan to support it? I may help if needed.

@simonplend
Copy link
Owner Author

@jledentu Great question. I just checked the Breaking Changes between v7 and v8 and they seem fairly minor (https://github.com/ajv-validator/ajv/releases/tag/v8.0.0).

I'm hoping to get the v2.2.0 release of this library out very soon and then I can focus on the v3.0.0 release. The original plan was for that release to introduce an upgrade from Ajv v6 to v7, but it looks like we might as well skip v7 and upgrade to v8.

I'd love help with this, thank you!

@matpen
Copy link

matpen commented May 30, 2021

Thank you for working on this. In my use case, I was trying to use ajv-formats with code like the following:

const { Validator } = require('express-json-validator-middleware');
const addFormats = require("ajv-formats");

const validator = new Validator();
addFormats(validator.ajv);

but got errors like TypeError: Cannot read property 'code' of undefined or similar.

For anyone interested, the temporary workaround is to downgrade to ajv-formats@3.2.1 which seems to work correctly with ajv@6.6.2 currently used by express-json-validator-middleware.

@simonplend simonplend changed the title Upgrade Ajv dependency to v7 Upgrade Ajv dependency to v8 Jul 9, 2021
@simonplend
Copy link
Owner Author

I've published a beta release with Ajv v8. Please give it a try and let me know if you run into any issues!

npm install express-json-validator-middleware@beta

This beta version should be compatible with the latest version of Ajv plugins such as ajv-formats.

/cc @jledentu @matpen

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

Successfully merging a pull request may close this issue.

3 participants