Skip to content

Commit a0d4c5c

Browse files
Google APIscopybara-github
authored andcommitted
fix!: mark Document.Entity.type as REQUIRED in all versions
fix!: remove Document.Entity.bounding_poly_for_demo_frontend from v1beta2 The type field was always required by the backend, so this formally breaking change can likely be accepted without bumping the major version. Field removal is in beta version so can be accepted as well. PiperOrigin-RevId: 444656928
1 parent 4bd299a commit a0d4c5c

4 files changed

Lines changed: 9 additions & 12 deletions

File tree

google/cloud/documentai/v1/document.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,8 @@ message Document {
476476
// [Document.text][google.cloud.documentai.v1.Document.text].
477477
TextAnchor text_anchor = 1 [(google.api.field_behavior) = OPTIONAL];
478478

479-
// Entity type from a schema e.g. `Address`.
480-
string type = 2;
479+
// Required. Entity type from a schema e.g. `Address`.
480+
string type = 2 [(google.api.field_behavior) = REQUIRED];
481481

482482
// Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
483483
// the entity is not present in the document, this field will be empty.

google/cloud/documentai/v1beta1/document.proto

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ syntax = "proto3";
1818
package google.cloud.documentai.v1beta1;
1919

2020
import "google/api/annotations.proto";
21+
import "google/api/field_behavior.proto";
2122
import "google/cloud/documentai/v1beta1/geometry.proto";
2223
import "google/rpc/status.proto";
2324
import "google/type/color.proto";
@@ -351,8 +352,8 @@ message Document {
351352
// [Document.text][google.cloud.documentai.v1beta1.Document.text].
352353
TextAnchor text_anchor = 1;
353354

354-
// Entity type from a schema e.g. `Address`.
355-
string type = 2;
355+
// Required. Entity type from a schema e.g. `Address`.
356+
string type = 2 [(google.api.field_behavior) = REQUIRED];
356357

357358
// Text value in the document e.g. `1600 Amphitheatre Pkwy`.
358359
string mention_text = 3;

google/cloud/documentai/v1beta2/document.proto

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,8 @@ message Document {
368368
// Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta2.Document.text].
369369
TextAnchor text_anchor = 1;
370370

371-
// Entity type from a schema e.g. `Address`.
372-
string type = 2;
371+
// Required. Entity type from a schema e.g. `Address`.
372+
string type = 2 [(google.api.field_behavior) = REQUIRED];
373373

374374
// Text value in the document e.g. `1600 Amphitheatre Pkwy`.
375375
string mention_text = 3;
@@ -387,10 +387,6 @@ message Document {
387387
// Optional. Canonical id. This will be a unique value in the entity list
388388
// for this document.
389389
string id = 7 [(google.api.field_behavior) = OPTIONAL];
390-
391-
// Optional. Temporary field to store the bounding poly for short-term POCs. Used by
392-
// the frontend only. Do not use before you talk to ybo@ and lukasr@.
393-
BoundingPoly bounding_poly_for_demo_frontend = 8 [(google.api.field_behavior) = OPTIONAL];
394390
}
395391

396392
// Relationship between [Entities][google.cloud.documentai.v1beta2.Document.Entity].

google/cloud/documentai/v1beta3/document.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,8 @@ message Document {
480480
// [Document.text][google.cloud.documentai.v1beta3.Document.text].
481481
TextAnchor text_anchor = 1 [(google.api.field_behavior) = OPTIONAL];
482482

483-
// Entity type from a schema e.g. `Address`.
484-
string type = 2;
483+
// Required. Entity type from a schema e.g. `Address`.
484+
string type = 2 [(google.api.field_behavior) = REQUIRED];
485485

486486
// Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If
487487
// the entity is not present in the document, this field will be empty.

0 commit comments

Comments
 (0)