Skip to main content

validate_write

Function validate_write 

Source
pub fn validate_write(
    schema: &ClassSchema,
    object: &ParseMap,
) -> Result<SchemaDelta, ParseError>
Expand description

Validate a write against a class schema and report what it would add.

Does not mutate. The caller persists the delta only if the write commits, which is the ordering that stops a rejected write from leaving a phantom column behind.

Order of checks per field is upstream’s and is observable, because the first failure is the error the client sees:

  1. Skip null, which creates nothing.
  2. If the field exists, the types must agree, else INCORRECT_TYPE.
  3. Otherwise the name must be legal, and it is an addition.