// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// yext extends the Protobuf FieldOptions to add allow new options to be
// set storing characteristics of the YANG schema from which a protobuf
// is generated.
syntax = "proto3";

import "google/protobuf/descriptor.proto";

package yext;

option go_package = "github.com/openconfig/ygot/proto/yext";

extend google.protobuf.FieldOptions {
  // schemapath stores the schema path to the field within the YANG schema.
  // The path stored is absolute if the entity is at the root of the schema
  // tree. In the case that it is not (i.e., it is an entity that has a parent
  // which is not a module, the path supplied is the relative path to the
  // parent of the entity). The field number for this extension is reserved
  // in the global protobuf registry.
  string schemapath = 1040;
  // leaflist indicates that the field represents a YANG leaf-list. It is
  // valid only for repeated fields, and can be used to determine that the
  // generated field is a list of scalar values by any parsing code.
  bool leaflist = 1179;
  // leaflistunion indicates that hte field represents a YANG leaf-list
  // of union types. It is valid only for repeated message fields and can be
  // used to determine that specific leaf-list union handling is required.
  bool leaflistunion = 1180;
}

extend google.protobuf.EnumValueOptions {
  // yang_name stores the original YANG name of the enumerated value, for
  // serialisation to a string. The field number for this extension is
  // reserved in the global protobuf registry.
  string yang_name = 1040;
}
