Files
Jia Hu 2a8a93311a Merged PR 1554321: [json schema] support keyword required
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
support keyword `required` in `$jsonSchema`

----
#### AI description  (iteration 1)
#### PR Classification
New feature

#### PR Summary
This pull request adds support for the `required` keyword in JSON schema validation.
- Added `ParseRequired` function to handle the `required` keyword in `bson_json_schema_tree.c`.
- Updated `BuildSchemaTreeCoreOnNode` to call `ParseRequired` when the `required` keyword is encountered.
- Modified `ValidateBsonValueObject` in `bson_json_schema_validator.c` to validate required fields.
- Added test cases for the `required` keyword in multiple test files (`bson_dollar_ops_json_schema_query_tests.out`, `bson_dollar_ops_json_schema_build_tree_tests.out`).
- Updated `ValidationsObject` structure in `bson_json_schema_tree.h` to include a `required` field.

Related work items: #4638803

Signed-off-by: Shuai Tian <shuaitian@microsoft.com>
2025-09-18 08:10:29 -07:00
..