Stubs

Module

stubs/wellknowntypes

The Protobuf well-known types (google/protobuf/*.proto), from Google's protobuf releases.

OfficialPublic

Message in pb

GoFeatures

pb.GoFeatures

Fields

FieldTypeNumberDescription
legacy_unmarshal_json_enumoptionalbool1

Whether or not to generate the deprecated UnmarshalJSON method for enums. Can only be true for proto using the Open Struct api.

  • option retention = RETENTION_RUNTIME;
  • option targets = [TARGET_TYPE_ENUM, TARGET_TYPE_FILE];
  • option edition_defaults = [{ value: "true" edition: EDITION_LEGACY }, { value: "false" edition: EDITION_PROTO3 }];
  • option feature_support = { edition_introduced: EDITION_2023 edition_deprecated: EDITION_2023 deprecation_warning: "The legacy UnmarshalJSON API is deprecated and will be removed in a future edition." };
api_leveloptionalAPILevel2

One of OPEN, HYBRID or OPAQUE.

  • option retention = RETENTION_RUNTIME;
  • option targets = [TARGET_TYPE_MESSAGE, TARGET_TYPE_FILE];
  • option edition_defaults = [{ value: "API_LEVEL_UNSPECIFIED" edition: EDITION_LEGACY }, { value: "API_OPAQUE" edition: EDITION_2024 }];
  • option feature_support = { edition_introduced: EDITION_2023 };
strip_enum_prefixoptionalStripEnumPrefix3
  • option retention = RETENTION_RUNTIME;
  • option targets = [TARGET_TYPE_ENUM, TARGET_TYPE_ENUM_ENTRY, TARGET_TYPE_FILE];
  • option edition_defaults = [{ value: "STRIP_ENUM_PREFIX_KEEP" edition: EDITION_LEGACY }];
  • option feature_support = { edition_introduced: EDITION_2024 };
optimize_modeoptionalOptimizeMode4
  • option retention = RETENTION_RUNTIME;
  • option targets = [TARGET_TYPE_MESSAGE, TARGET_TYPE_FILE];
  • option edition_defaults = [{ value: "OPTIMIZE_MODE_UNSPECIFIED" edition: EDITION_LEGACY }];
  • option feature_support = { edition_introduced: EDITION_2024 };

Nested messages

  • OptimizeModeFeatureWrap the OptimizeMode enum in a message for scoping: This way, users can type shorter names (SPEED, CODE_SIZE).

Nested enums

Used by

Defined in google/protobuf/go_features.proto