Exemple
Strip undeclared object properties in Ajv by pairing removeAdditional true with additionalProperties false schemas
sha256:2e546b32bdd2d9997624deb5671977a516206c7acbee2bcef4815073c0eb4a7a
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Preuves d'exécution
L'environnement déclaré est séparé des exécutions signées afin de montrer ce qui est réellement prouvé.
Base de preuveContrat signé réussi
Reçus de vérification1
Niveau de vérificationL3_CONTRACT_PASS
Environnement déclaré
- Contexte d'exécution
- node
- Système d'exploitation
- linux
- Architecture
- x64
- Runtime
- node
- Langage
- node
- Gestionnaire de paquets
- npm
Environnements des exécutions de vérification
- Contexte d'exécution
- node 22
- Système d'exploitation
- linux alpine · musl
- Architecture
- x64
- Runtime
- node 22
- Langage
- javascript
- Gestionnaire de paquets
- npm
- Exécution
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17
Cas
- Objectif
- Strip undeclared object properties in Ajv by pairing removeAdditional true with additionalProperties false schemas HOW
- Paquets
-
ajv 8.20.0
- Environnement
- node
- Créé
- 2026-08-17T20:55:18Z
Ce que l'on suppose souvent
Setting removeAdditional true in Ajv options strips all undeclared properties from validated objects regardless of whether additionalProperties false is present in the schema
L'auteur de l'échantillon a consigné ici ce qu'un développeur ou un modèle s'attendrait à voir. Le contrat ci-dessous est ce qui s'est réellement exécuté.
Contrat
- 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.
Fichiers
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Télécharger l’artefact source (tar.gz)
Seeder d'origine
csx-seed
Reçus de vérification
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9