//% descriptor: true
syntax = "proto2";

package buf.test;

import "google/protobuf/any.proto";
import "google/protobuf/descriptor.proto";

option (x) = { [type.googleapis.com/buf.test.Foo] {
    x1: 42, x2: "foo"
}};

option (y) = { [type.googleprod.com/buf.test.Foo] {
    x1: 42, x2: "foo"
}};

option (y) = { [buf.build/types/buf.test.Foo] {
    x1: 42, x2: "foo"
}};

option (y) = { [/buf.test.Foo] {
    x1: 42, x2: "foo"
}};

option (y) = { [type.googleapis.com/Foo] {
    x1: 42, x2: "foo"
}};

option (y) = {
    [type.googleapis.com/google.protobuf.Any] {
        [type.googleapis.com/buf.test.Foo] {
            x1: 42, x2: "foo"
        }
    }
};

option (y) = {
    [type.googleapis.com/google.protobuf.Any] {
        [type.googleapis.com/google.protobuf.Any] {
            [type.googleapis.com/buf.test.Foo] {
                x1: 42, x2: "foo"
            }
        }
    }
};


option (y) = { [type.googleapis.com/buf.test.Foo] {
    a: [
        {
            [type.googleapis.com/buf.test.Foo]: { x1: 42 }
            [type.googleapis.com/google.protobuf.FileOptions]: {}
        },
        {
            type_url: "type.googleapis.com/buf.test.Bar"
            [type.googleapis.com/buf.test.Foo]: { x1: 42 }
            bytes: "xyz"
        },
        {
            type_url: "type.googleapis.com/buf.test.Bar"
            value: "xyz"
        },
        { [type.googleapis.com/buf.test.Foo]: 42 },
        { [type.googleapis.com/buf.test.Bar]: BAR_ZERO },
        { [type.googleapis.com/buf.test.NotReal]: {} },
        { [type.googleapis.com/buf.test.Foo.a]: 42 }
    ]
}};

message Foo {
    optional int32 x1 = 1;
    optional string x2 = 2;

    repeated google.protobuf.Any a = 3;
}

enum Bar {
    BAR_ZERO = 0;
}

extend google.protobuf.FileOptions {
    optional google.protobuf.Any x = 1000;
    repeated google.protobuf.Any y = 1001;
}