Skip to main content

SchemaCompatibilityStatusBeta Interface

SchemaCompatibilityStatus with additional beta APIs.

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 interface SchemaCompatibilityStatusBeta extends SchemaCompatibilityStatus

Extends: SchemaCompatibilityStatus

Properties

PropertyAlertsModifiersTypeDescription
discrepanciesBetareadonlyreadonly SchemaDiscrepancy[] | undefinedDetails about the schema discrepancies that prevent this view from accessing the tree.

Property Details

discrepancies

Details about the schema discrepancies that prevent this view from accessing the tree.

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

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

Signature

readonly discrepancies: readonly SchemaDiscrepancy[] | undefined;

Type: readonly SchemaDiscrepancy[] | undefined

Remarks

This property is undefined when canView is true and present when canView is false. It can include application-defined schema identifiers and field keys.

Example

Interpreting an allowed-types discrepancy

If a document's stored schema allows string for Todo.title, but the view schema expects number, the discrepancy identifies the field and the type permitted by each schema:

const sf = new SchemaFactory("com.example");
class Todo extends sf.object("Todo", {
title: sf.number,
}) {}

const view = asBeta(tree.viewWith(new TreeViewConfiguration({ schema: Todo })));
if (!view.compatibility.canView) {
// [{
// mismatch: "allowedTypes",
// location: { nodeType: "com.example.Todo", fieldKey: "title" },
// view: ["com.fluidframework.leaf.number"],
// stored: ["com.fluidframework.leaf.string"],
// }]
console.error(view.compatibility.discrepancies);
}