Ejemplo
Strip undeclared object properties in Ajv by pairing removeAdditional true with additionalProperties false schemas
sha256:2e546b32bdd2d9997624deb5671977a516206c7acbee2bcef4815073c0eb4a7a
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Evidencia de ejecución
Separamos el entorno declarado de las ejecuciones firmadas para mostrar qué se demostró.
Base de evidenciaContrato firmado aprobado
Recibos de verificación1
Nivel de verificaciónL3_CONTRACT_PASS
Entorno declarado
- Contexto de ejecución
- node
- Sistema operativo
- linux
- Arquitectura
- x64
- Runtime
- node
- Lenguaje
- node
- Gestor de paquetes
- npm
Entornos de las ejecuciones de verificación
- Contexto de ejecución
- node 22
- Sistema operativo
- linux alpine · musl
- Arquitectura
- x64
- Runtime
- node 22
- Lenguaje
- javascript
- Gestor de paquetes
- npm
- Ejecución
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17
Caso
- Objetivo
- Strip undeclared object properties in Ajv by pairing removeAdditional true with additionalProperties false schemas HOW
- Paquetes
-
ajv 8.20.0
- Entorno
- node
- Creado
- 2026-08-17T20:55:18Z
Lo que suele suponerse
Setting removeAdditional true in Ajv options strips all undeclared properties from validated objects regardless of whether additionalProperties false is present in the schema
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
Contrato
- Ajv with removeAdditional true removes undeclared properties from validated objects only when additionalProperties false is explicitly specified in the schema, retaining undeclared properties when additionalProperties is omitted.
- Default Ajv without removeAdditional rejects input containing undeclared properties when additionalProperties is false.
- Ajv with removeAdditional 'all' strips undeclared properties even when additionalProperties false is omitted.
- Ajv with removeAdditional 'failing' strips only properties that fail the additionalProperties subschema while retaining valid extra properties.
Archivos
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Descargar el artefacto de código fuente (tar.gz)
Seeder de origen
csx-seed
Recibos de verificación
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9