Skip to content

fix: bump jsonchema to resolve url.parse deprecation#573

Open
willmizzi wants to merge 1 commit intotywalch:masterfrom
willmizzi:fix/jsonschema-url-parse
Open

fix: bump jsonchema to resolve url.parse deprecation#573
willmizzi wants to merge 1 commit intotywalch:masterfrom
willmizzi:fix/jsonschema-url-parse

Conversation

@willmizzi
Copy link
Copy Markdown

@willmizzi willmizzi commented Apr 22, 2026

Summary

Fixes #571.

Node v24 emits a [DEP0169] deprecation warning against consumers of ElectroDB because jsonschema@1.2.7 uses the legacy require('url').parse() API.

Upgrading to jsonschema@1.5.0 removes the url module entirely in favour of the WHATWG URL global, silencing the warning.

Changes

  • package.json — bump jsonschema from 1.2.7 → 1.5.0.
  • src/validations.js — pass the ModelBeta / Modelv1 schema objects directly to v.validate() instead of their URI strings ("/ModelBeta" / "/Modelv1").

More detail

jsonschema@1.5.0 updated the Validator.prototype.validate() entry point to reject anything that isn't an object or boolean:

// jsonschema/lib/validator.js
if ((typeof schema !== 'boolean' && typeof schema !== 'object') || schema === null) {
  throw new SchemaError('Expected `schema` to be an object or boolean');
}

Testing

  • npm run test:types
  • npm run test:unit
  • ./test.sh

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 22, 2026

Deploy Preview for electrodb-dev canceled.

Name Link
🔨 Latest commit 18f03c4
🔍 Latest deploy log https://app.netlify.com/projects/electrodb-dev/deploys/69e8666cfbe17e00083b4543

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 this pull request may close these issues.

ElectroDB relies on old version of jsonschema module that uses deprecated url.parse() instead of the WHATWG URL API

1 participant