Skip to main content

SchemaDiscrepancy TypeAlias

A discrepancy between a view schema and a document's stored schema.

This API is provided as a beta preview and may change without notice.

To use, import via fluid-framework/beta.

For more information about our API support guarantees, see here.

Sealed

This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.

Signature

/** @sealed */
export type SchemaDiscrepancy = {
readonly mismatch: "allowedTypes";
readonly location: "root" | {
readonly nodeType: string;
readonly fieldKey: string | undefined;
};
readonly view: readonly string[];
readonly stagedView?: readonly string[];
readonly stored: readonly string[];
readonly viewIsStagedOptional?: true;
} | {
readonly mismatch: "fieldKind";
readonly location: "root" | {
readonly nodeType: string;
readonly fieldKey: string | undefined;
};
readonly view: string;
readonly stored: string;
readonly viewIsStagedOptional?: true;
} | {
readonly mismatch: "valueSchema";
readonly nodeType: string;
readonly view: string | undefined;
readonly stored: string | undefined;
} | {
readonly mismatch: "nodeKind";
readonly nodeType: string;
readonly view: string;
readonly stored: string;
};

Remarks

The mismatch property discriminates the different discrepancy shapes.