Skip to main content

validate_write_fields

Function validate_write_fields 

Source
pub fn validate_write_fields(
    schema: &ClassSchema,
    fields: &IndexMap<String, FieldWrite>,
) -> Result<SchemaDelta, ParseError>
Expand description

The op-aware form of validate_write.

Same rules, one extra source of type information: an {"__op":...} field infers through infer_op_type rather than infer_type, so AddRelation reserves Relation<targetClass> and Increment reserves Number. Upstream does not distinguish the two paths at all, because getType handles literals and ops in one function (SchemaController.js:1555-1657); the split here exists because parse-rust decodes ops into FieldWrite before the schema layer sees them.

validate_write is kept for callers that hold a plain body. It is not a subset: a body that still carries {"__op":"Increment"} as a literal object infers Object through it, which is how 0.1.0 came to store the op envelope as a column value.