Skip to content

Why are repeated fields only allowed at the last position of a paths string? #1315

Open
@nnutter

Description

@nnutter

#1179 broke us and I don't understand why this constraint exists. It noted,

field_mask.proto mentions that ...

// Field masks are used to specify a subset of fields that should be
// returned by a get operation or modified by an update operation.

...

// # Field Masks in Projections
// ...
// A repeated field is not allowed except at the last position of a
// paths string.

...

// # Field Masks in Update Operations
// ...
// Note that a repeated field is only allowed in the last position of a `paths` string.

Given those statements, I think FieldMask.IsValid should return false if a path contains a repeated field that is not in the last position.

Given the example in #1179 why is nests.s not a reasonable path? Imagine extending Nested with a second field. It seems reasonable to say you want one of those fields but not both.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions