Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-103983

[Spike] QtProtobuf: Investigate additonal wellknown type support

    XMLWordPrintable

Details

    • Task
    • Resolution: Duplicate
    • P2: Important
    • None
    • None
    • Core: Serialization
    • None
    • 5
    • Foundation Sprint 70, Foundation Sprint 93

    Description

      https://developers.google.com/protocol-buffers/docs/reference/google.protobuf
      Like the Any type there may be additional types in the "well-known" types library which may need additional codegen or features to support it.

       Full list of types that are considered well-known:

      google/protobuf/any.proto
      google/protobuf/api.proto
      google/protobuf/compiler/plugin.proto 
      google/protobuf/descriptor.proto
      google/protobuf/duration.proto
      google/protobuf/empty.proto
      google/protobuf/field_mask.proto
      google/protobuf/source_context.proto
      google/protobuf/struct.proto
      google/protobuf/timestamp.proto
      google/protobuf/type.proto
      google/protobuf/wrappers.proto
      

      Upstream's C++ and Java APIs seem only handle Any type in a special way, providing methods to encode and decode messages. Otherwise those types are only put into a special namespace (C++). There are also utilities for Duration and Timestamp types. Objective-C API is not even handling Any type in a special way.

      C# API has special handling for wrapper types, where they are replaced by Nullable<T> where T is the wrapped type.

      We may implement the encoding/decoding of Any messages as in C++ API. I don't think that we need any further support for those types as of now.

      We may want to provide an easy way to use those files in user programs though so users don't need to bundle all those proto files themselves. That may have consequences for API and ABI stability though. Some well-known types have special JSON representation, so if we ever going to support that it will require some work.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              tatiana.borisova Tatiana Borisova
              manordheim Mårten Nordheim
              Vladimir Minenko Vladimir Minenko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes