MCPcopy Create free account
hub / github.com/documentdb/documentdb / CheckSyntaxForValidator

Function CheckSyntaxForValidator

pg_documentdb/src/metadata/collection.c:1905–1920  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1903
1904
1905static void
1906CheckSyntaxForValidator(const bson_iter_t *validator)
1907{
1908 if (bson_iter_type(validator) != BSON_TYPE_DOCUMENT)
1909 {
1910 ereport(ERROR, (errcode(ERRCODE_DOCUMENTDB_TYPEMISMATCH),
1911 errmsg("$jsonSchema must be of object type")));
1912 }
1913
1914 bson_iter_t schemaIter;
1915 if (bson_iter_recurse(validator, &schemaIter))
1916 {
1917 SchemaTreeState localTreeState = { };
1918 BuildSchemaTree(&localTreeState, &schemaIter);
1919 }
1920}
1921
1922
1923/*

Callers 1

ProcessJsonschemaInIterFunction · 0.85

Calls 1

BuildSchemaTreeFunction · 0.85

Tested by

no test coverage detected