Warning, /include/google/protobuf/go_features.proto is written in an unsupported language. File is not indexed.
0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2023 Google Inc. All rights reserved.
0003 //
0004 // Use of this source code is governed by a BSD-style
0005 // license that can be found in the LICENSE file or at
0006 // https://developers.google.com/open-source/licenses/bsd
0007
0008 syntax = "proto2";
0009
0010 package pb;
0011
0012 import "google/protobuf/descriptor.proto";
0013
0014 option go_package = "google.golang.org/protobuf/types/gofeaturespb";
0015
0016 extend google.protobuf.FeatureSet {
0017 optional GoFeatures go = 1002;
0018 }
0019
0020 message GoFeatures {
0021 // Whether or not to generate the deprecated UnmarshalJSON method for enums.
0022 // Can only be true for proto using the Open Struct api.
0023 optional bool legacy_unmarshal_json_enum = 1 [
0024 retention = RETENTION_RUNTIME,
0025 targets = TARGET_TYPE_ENUM,
0026 targets = TARGET_TYPE_FILE,
0027 feature_support = {
0028 edition_introduced: EDITION_2023,
0029 edition_deprecated: EDITION_2023,
0030 deprecation_warning: "The legacy UnmarshalJSON API is deprecated and "
0031 "will be removed in a future edition.",
0032 },
0033 edition_defaults = { edition: EDITION_LEGACY, value: "true" },
0034 edition_defaults = { edition: EDITION_PROTO3, value: "false" }
0035 ];
0036
0037 enum APILevel {
0038 // API_LEVEL_UNSPECIFIED results in selecting the OPEN API,
0039 // but needs to be a separate value to distinguish between
0040 // an explicitly set api level or a missing api level.
0041 API_LEVEL_UNSPECIFIED = 0;
0042 API_OPEN = 1;
0043 API_HYBRID = 2;
0044 API_OPAQUE = 3;
0045 }
0046
0047 // One of OPEN, HYBRID or OPAQUE.
0048 optional APILevel api_level = 2 [
0049 retention = RETENTION_RUNTIME,
0050 targets = TARGET_TYPE_MESSAGE,
0051 targets = TARGET_TYPE_FILE,
0052 feature_support = {
0053 edition_introduced: EDITION_2023,
0054 },
0055 edition_defaults = {
0056 edition: EDITION_LEGACY,
0057 value: "API_LEVEL_UNSPECIFIED"
0058 },
0059 edition_defaults = { edition: EDITION_2024, value: "API_OPAQUE" }
0060 ];
0061
0062 enum StripEnumPrefix {
0063 STRIP_ENUM_PREFIX_UNSPECIFIED = 0;
0064 STRIP_ENUM_PREFIX_KEEP = 1;
0065 STRIP_ENUM_PREFIX_GENERATE_BOTH = 2;
0066 STRIP_ENUM_PREFIX_STRIP = 3;
0067 }
0068
0069 optional StripEnumPrefix strip_enum_prefix = 3 [
0070 retention = RETENTION_RUNTIME,
0071 targets = TARGET_TYPE_ENUM,
0072 targets = TARGET_TYPE_ENUM_ENTRY,
0073 targets = TARGET_TYPE_FILE,
0074 feature_support = {
0075 edition_introduced: EDITION_2024,
0076 },
0077 // TODO: change the default to STRIP_ENUM_PREFIX_STRIP for edition 2025.
0078 edition_defaults = {
0079 edition: EDITION_LEGACY,
0080 value: "STRIP_ENUM_PREFIX_KEEP"
0081 }
0082 ];
0083 }