File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,14 @@ const bsonDocuments = [{
3030describe . only ( 'Documents -> Generate schema -> Validate Documents against the schema' , function ( ) {
3131 it ( 'Standard JSON Schema with Relaxed EJSON' , async function ( ) {
3232 const ajv = new Ajv2020 ( ) ;
33- // First we get the schema
33+ // First we get the JSON schema from BSON
3434 const analyzedDocuments = await analyzeDocuments ( bsonDocuments ) ;
3535 const schema = await analyzedDocuments . getStandardJsonSchema ( ) ;
3636 const validate = ajv . compile ( schema ) ;
3737 for ( const doc of bsonDocuments ) {
38- // Then we get EJSON documents
38+ // Then we get EJSON
3939 const relaxedEJSONDoc = EJSON . serialize ( doc , { relaxed : true } ) ;
40- // Which we validate against the schema
40+ // And validate it agains the JSON Schema
4141 const valid = validate ( relaxedEJSONDoc ) ;
4242 if ( validate . errors ) console . error ( 'Validation failed' , validate . errors ) ;
4343 assert . strictEqual ( valid , true ) ;
You can’t perform that action at this time.
0 commit comments