Set the schema but ensure unexpected fields won't be accepted
| 116 | } |
| 117 | // Set the schema but ensure unexpected fields won't be accepted |
| 118 | void SetStrictSchema(std::shared_ptr<Schema> explicit_schema) { |
| 119 | auto unexpected_field_behavior = parse_options_.unexpected_field_behavior; |
| 120 | if (unexpected_field_behavior == UnexpectedFieldBehavior::InferType) { |
| 121 | unexpected_field_behavior = UnexpectedFieldBehavior::Error; |
| 122 | } |
| 123 | SetSchema(std::move(explicit_schema), unexpected_field_behavior); |
| 124 | } |
| 125 | |
| 126 | [[nodiscard]] MemoryPool* pool() const { return pool_; } |
| 127 | [[nodiscard]] const ParseOptions& parse_options() const { return parse_options_; } |