Computer scienceFundamentalsEssentialsStandards and formatsData formats

Introduction to Protocol Buffers

Compatibility in action

Report a typo

// v2.proto

syntax = "proto3";

message Book {
  string title = 1;
  optional string subtitle = 2;
  string author = 3;
  int32 yearPublished = 4;
  string ISBN = 5;
  float price = 6;
  bool isNewRelease = 7;
}

The above schema is used to serialize the data below to get book.bin:

title: "C Programming"
subtitle: "Absolute Beginner's Guide"
author: "Greg Perry"
yearPublished: 2017
ISBN: "9781098117253"
price: 17.99
isNewRelease: true

The below schema is then used to deserialize book.bin:

// v1.proto

syntax = "proto3";

message Book {
  reserved 7;

  string title = 1;
  optional string subtitle = 2;
  string author = 3;
  int32 yearPublished = 4;
  string ISBN = 5;
  float price = 6;
}

Select ALL that apply.

Select one or more options from the list
___

Create a free account to access the full topic