Skip to content

fieldMaskFromBehavior

fieldMaskFromBehavior(schema, exclude, opts?): FieldMask

Defined in: packages/aip/src/fieldbehavior/mask.ts:38

Creates a FieldMask containing all fields on the schema that do NOT have any of the specified FieldBehavior annotations. The function recurses into nested message, repeated message, and map-of-message fields so that excluded behaviours are filtered at every level of the message tree.

When maxDepth is reached or a self-referential type is encountered the field path is included without further recursion, preserving the entire subtree.

The returned mask uses non-strict validation to support wildcard paths for repeated and map fields (e.g. repeated_child.*.field).

DescMessage

The message descriptor to inspect.

FieldBehavior[]

The field behaviors to exclude from the resulting mask.

FieldMaskFromBehaviorOptions

Optional settings.

FieldMask

A validated FieldMask with excluded-behaviour fields removed.