All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scalapb.scalapb.proto Maven / Gradle / Ivy

The newest version!
syntax = "proto2";

package scalapb;

option java_package = "com.trueaccord.scalapb";

import "google/protobuf/descriptor.proto";

message ScalaPbOptions {
  // If set then it overrides the java_package and package.
  optional string package_name = 1;

  // If true, the compiler does not append the proto base file name
  // into the generated package name. If false (the default), the
  // generated scala package name is the package_name.basename where
  // basename is the proto file name without the .proto extension.
  optional bool flat_package = 2;

  // Adds the following imports at the top of the file (this is meant
  // to provide implicit TypeMappers)
  repeated string import = 3;

  // Text to add to the generated scala file.  This can be used only
  // when single_file is true.
  repeated string preamble = 4;

  // If true, all messages and enums (but not services) will be written
  // to a single Scala file.
  optional bool single_file = 5;

  // By default, wrappers defined at
  // https://github.com/google/protobuf/blob/master/src/google/protobuf/wrappers.proto,
  // are mapped to an Option[T] where T is a primitive type. When this field
  // is set to true, we do not perform this transformation.
  optional bool no_primitive_wrappers = 7;

  // DEPRECATED. In ScalaPB <= 0.5.47, it was necessary to explicitly enable
  // primitive_wrappers. This field remains here for backwards compatibility,
  // but it has no effect on generated code. It is an error to set both
  // `primitive_wrappers` and `no_primitive_wrappers`.
  optional bool primitive_wrappers = 6;

  // Scala type to be used for repeated fields. If unspecified,
  // `scala.collection.Seq` will be used.
  optional string collection_type = 8;

  // For use in tests only. Inhibit Java conversions even when when generator parameters
  // request for it.
  optional bool test_only_no_java_conversions = 100001;
}

extend google.protobuf.FileOptions {
  // File-level optionals for ScalaPB.
  // Extension number officially assigned by [email protected]
  optional ScalaPbOptions options = 1020;
}

message MessageOptions {
  // Additional classes and traits to mix in to the case class.
  repeated string extends = 1;

  // Additional classes and traits to mix in to the companion object.
  repeated string companion_extends = 2;

  // Custom annotations to add to the generated case class.
  repeated string annotations = 3;

  // All instances of this message will be converted to this type. An implicit TypeMapper
  // must be present.
  optional string type = 4;
}

extend google.protobuf.MessageOptions {
  // Message-level optionals for ScalaPB.
  // Extension number officially assigned by [email protected]
  optional MessageOptions message = 1020;
}

message FieldOptions {
  optional string type = 1;

  optional string scala_name = 2;

  // Can be specified only if this field is repeated. If unspecified,
  // it falls back to the file option named `collection_type`, which defaults
  // to `scala.collection.Seq`.
  optional string collection_type = 3;

  // If the field is a map, you can specify custom Scala types for the key
  // or value.
  optional string key_type = 4;
  optional string value_type = 5;
}

extend google.protobuf.FieldOptions {
  // Field-level optionals for ScalaPB.
  // Extension number officially assigned by [email protected]
  optional FieldOptions field = 1020;
}

message EnumOptions {
  // Additional classes and traits to mix in to the base trait
  repeated string extends = 1;

  // Additional classes and traits to mix in to the companion object.
  repeated string companion_extends = 2;

  // All instances of this enum will be converted to this type. An implicit TypeMapper
  // must be present.
  optional string type = 3;
}

extend google.protobuf.EnumOptions {
  // Enum-level optionals for ScalaPB.
  // Extension number officially assigned by [email protected]
  //
  // The field is called enum_options and not enum since enum is not allowed in Java.
  optional EnumOptions enum_options = 1020;
}

message EnumValueOptions {
  // Additional classes and traits to mix in to an individual enum value.
  repeated string extends = 1;
}

extend google.protobuf.EnumValueOptions {
  // Enum-level optionals for ScalaPB.
  // Extension number officially assigned by [email protected]
  optional EnumValueOptions enum_value = 1020;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy