After playing with it a bit I think I can't actually change the top level
"thing" to not be an option since an option is the (only?) way for a
developer to give values for a pre-defined data structure.
I guess I'm down to dropping the inner options and duplicating the data
structures unless some hero will save my day :)
On Sunday, February 23, 2020 at 5:00:05 PM UTC+2, ittai zeidman wrote:
>
> Hi,
> I'm trying to write a proto file which has an option on a service and
> inside the option I'd like to have an option on one of the inner messages:
>
> service SomeService {
> option (wix.api.genService) = {
> entity: "SomeServiceData"
> endpoints {
> create {
> option(wix.api.metadata).name = "SOME_VALUE";
> };
> };
> };
> }
> This fails saying: "Message type "wix.api.GenEndpoint" has no field named
> "option"." (create is of type GenEndpoint).
>
> I'm fairly certain I can change the inner option to be a regular field but
> then my developers will need to know two different syntax (one when they're
> using the highlevel transpiled DSL and the regular proto one for other
> tasks).
> I can also change the top level "thing" to not be an option and instead be
> a typed message but this feels a bit iffy (maybe less than the above two
> options).
>
> This test below seems to suggest what I want to do is achievable but I
> wasn't able to understand how to use it...
>
> https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/unittest_custom_options.proto#L360
>
> Would love your help,
> Ittai
>
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/protobuf/bf6ad797-cc09-4426-829f-7503a0856986%40googlegroups.com.