package ocaml-protoc-plugin

  1. Overview
  2. Docs

Api is a light-weight descriptor for an API Interface.

Interfaces are also described as "protocol buffer services" in some contexts, such as by the "service" keyword in a .proto file, but they are different from API Services, which represent a concrete implementation of an interface as opposed to simply a description of methods and bindings. They are also sometimes simply referred to as "APIs" in other contexts, such as the name of this message itself. See for detailed terminology.

type t = {
  1. name : string;

    The fully qualified name of this interface, including package name followed by the interface's simple name.

  2. methods : Method.t list;

    The methods of this interface, in unspecified order.

  3. options : Type.Google.Protobuf.Option.t list;

    Any metadata attached to the interface.

  4. version : string;

    A version string for this interface. If specified, must have the form `major-version.minor-version`, as in `1.10`. If the minor version is omitted, it defaults to zero. If the entire version field is empty, the major version is derived from the package name, as outlined below. If the field is not empty, the version in the package name will be verified to be consistent with what is provided here.

    The versioning schema uses [semantic versioning]( where the major version number indicates a breaking change and the minor version an additive, non-breaking change. Both version numbers are signals to users what to expect from different versions, and should be carefully chosen based on the product plan.

    The major version is also reflected in the package name of the interface, which must end in `v<major-version>`, as in `google.feature.v1`. For major versions 0 and 1, the suffix can be omitted. Zero major versions must only be used for experimental, non-GA interfaces.

  5. source_context : Source_context.Google.Protobuf.SourceContext.t option;

    Source context for the protocol buffer service represented by this message.

  6. mixins : Mixin.t list;

    Included interfaces. See [Mixin][].

  7. syntax : Type.Google.Protobuf.Syntax.t;

    The source syntax of the service.

val make : ?name:string -> ?methods:Method.t list -> ?options:Type.Google.Protobuf.Option.t list -> ?version:string -> ?source_context:Source_context.Google.Protobuf.SourceContext.t -> ?mixins:Mixin.t list -> ?syntax:Type.Google.Protobuf.Syntax.t -> unit -> t

Helper function to generate a message using default values

Serialize the message to binary format

Deserialize from binary format

Serialize to Json (compatible with Yojson.Basic.t)

Deserialize from Json (compatible with Yojson.Basic.t)

val name : unit -> string

Fully qualified protobuf name of this message


Innovation. Community. Security.