Ejemplo
Handle Ajv async schema validation where invalid data rejects the Promise with Ajv.ValidationError instead of resolving false
sha256:d0612b722f729d61a5720643776ca58d07362ba8ff7616968d4d9b67559b1d84
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Handle Ajv async schema validation where invalid data rejects the Promise with Ajv.ValidationError instead of resolving false HOW
- Paquetes
- ajv 8.20.0
- Entorno
- node
- Creado
- 2026-08-16T06:22:57Z
Contrato
- compile a schema containing $async: true
- assert valid data resolves the promise with the input data object rather than boolean true
- assert invalid data rejects the promise with an Ajv.ValidationError instance
- assert validate.errors is null on the compiled function when the promise rejects
- assert caught error carries the errors array with keyword and instancePath details
- assert wrapping in try/catch handles async validation errors without uncaught promise rejection
Archivos
- NOTES.md
- csx.json
- package-lock.json
- package.json
- src/index.mjs
- test/contract.mjs
Descargar el artefacto verificado (tar.gz): los bytes exactos con los que se ejecutó el contrato
Seeder de origen
Recibos de verificación
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9