Back to problems

Validate JSON against Protobuf

Algorithm · Applied Intuition · Medium

Problem Statement You are given a Protobuf schema that describes the fields of a message type. Each field has a declared type, and a field is either required or optional. Your task is to implement a validator that checks whether a JSON object is a valid instance of the schema. Special attention should be paid to optional fields: If an optional field is missing, the object is still valid. If an optional field is present, its value must still match the declared type. Required…

Checking your access…