-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Final updates to runtime and codegen fixes (#352)
Uncovered a few bugs when starting to demonstrate some internal upgrades. - A few message interface implementation bugs - Removed files break Buf breaking checks Puts back a non-null accessor generator option for oneof fields. New extension number reservation has been approved: protocolbuffers/protobuf#20485
- Loading branch information
1 parent
1a295b9
commit d5fcf93
Showing
52 changed files
with
2,179 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
305 changes: 304 additions & 1 deletion
305
extensions/protokt-extensions-lite/api/protokt-extensions-lite.api
Large diffs are not rendered by default.
Oops, something went wrong.
219 changes: 219 additions & 0 deletions
219
extensions/protokt-extensions-lite/src/extensions-proto/protokt/protokt.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,219 @@ | ||
/* | ||
* Copyright (c) 2019 Toast, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
syntax = "proto3"; | ||
|
||
package protokt; | ||
|
||
import "google/protobuf/descriptor.proto"; | ||
|
||
option java_package = "com.toasttab.protokt.ext"; | ||
option java_outer_classname = "ProtoktProto"; | ||
|
||
option deprecated = true; | ||
|
||
message ProtoktFileOptions { | ||
option deprecated = true; | ||
|
||
// Specify the Kotlin package for the generated file. Precedence is given | ||
// first to this Kotlin package, then to the Java package if enabled in | ||
// the plugin options, and finally to the protobuf package. | ||
string kotlin_package = 1 [deprecated = true]; | ||
|
||
// Specify the name of the Kotlin object that contains the reference to this | ||
// file's FileDescriptor object. | ||
string file_descriptor_object_name = 2 [deprecated = true]; | ||
} | ||
|
||
extend google.protobuf.FileOptions { | ||
ProtoktFileOptions file = 1072 [deprecated = true]; | ||
} | ||
|
||
message ProtoktMessageOptions { | ||
option deprecated = true; | ||
|
||
// Declares that the message class implements an interface. Scoping rules | ||
// are the same as those for declaring wrapper types. | ||
string implements = 1 [deprecated = true]; | ||
|
||
// Provides a message for deprecation | ||
string deprecation_message = 2 [deprecated = true]; | ||
} | ||
|
||
extend google.protobuf.MessageOptions { | ||
ProtoktMessageOptions class = 1072 [deprecated = true]; | ||
} | ||
|
||
message ProtoktFieldOptions { | ||
option deprecated = true; | ||
|
||
// Makes a message-type field non-nullable in the generated Kotlin code. | ||
// Beware that deserialization will NPE if the field is missing from the | ||
// protobuf payload. Adding a non-null field to an existing message is a | ||
// backwards-incompatible change. | ||
// | ||
// For example: | ||
// | ||
// message Foo { | ||
// string id = 1 [(protokt.property).non_null = true]; | ||
// } | ||
bool non_null = 1 [deprecated = true]; | ||
|
||
// Expose a wrapper class instead of a raw protobuf type. | ||
// | ||
// For example: | ||
// | ||
// message Foo { | ||
// string id = 1 [(protokt.property).wrap = "com.foo.FooId"]; | ||
// } | ||
// | ||
// data class FooId(val value: String) | ||
// | ||
// will yield: | ||
// class Foo(val id: FooId) ... | ||
// | ||
// If the Kotlin package (or Java package, if the Kotlin package is | ||
// unspecified) of this file is the same as the package of the wrapper type, | ||
// full qualification is optional. | ||
// | ||
// This option can be applied to repeated fields. | ||
string wrap = 2 [deprecated = true]; | ||
|
||
// Maps a bytes field to BytesSlice. If deserialized from a byte array, | ||
// BytesSlice will point to the source array without copying the subarray. | ||
bool bytes_slice = 3 [deprecated = true]; | ||
|
||
// Provides a message for deprecation | ||
string deprecation_message = 4 [deprecated = true]; | ||
|
||
// Expose a wrapper class instead of a raw protobuf type for the key type of | ||
// a map. | ||
// | ||
// For example: | ||
// | ||
// message Foo { | ||
// map<string, int32> map = 1 [(protokt.property).key_wrap = "com.foo.FooId"]; | ||
// } | ||
// | ||
// data class FooId(val value: String) | ||
// | ||
// will yield: | ||
// class Foo(val map: Map<FooId, String>) ... | ||
// | ||
// Scoping rules are the same as those for declaring regular field wrapper types. | ||
string key_wrap = 5 [deprecated = true]; | ||
|
||
// Expose a wrapper class instead of a raw protobuf type for the value type of | ||
// a map. | ||
// | ||
// For example: | ||
// | ||
// message Foo { | ||
// map<int32, strig> map = 1 [(protokt.property).value_wrap = "com.foo.FooId"]; | ||
// } | ||
// | ||
// data class FooId(val value: String) | ||
// | ||
// will yield: | ||
// class Foo(val map: Map<Int, FooId>) ... | ||
// | ||
// Scoping rules are the same as those for declaring regular field wrapper types. | ||
string value_wrap = 6 [deprecated = true]; | ||
} | ||
|
||
extend google.protobuf.FieldOptions { | ||
ProtoktFieldOptions property = 1072 [deprecated = true]; | ||
} | ||
|
||
message ProtoktOneofOptions { | ||
option deprecated = true; | ||
|
||
// Makes a oneof field non-nullable in generated Kotlin code. Beware that | ||
// deserialization will NPE if the field is missing from the protobuf payload. | ||
// Adding a non-null field to an existing message is a backwards-incompatible | ||
// change. | ||
// | ||
// For example: | ||
// | ||
// message Message { | ||
// oneof some_field_name { | ||
// option (protokt.oneof).non_null = true; | ||
// | ||
// string id = 1; | ||
// } | ||
// } | ||
// | ||
bool non_null = 1 [deprecated = true]; | ||
|
||
// Make the sealed class implement an interface, enforcing the presence of a | ||
// property in each possible variant. Scoping rules are the same as those | ||
// for declaring wrapper types. | ||
string implements = 2 [deprecated = true]; | ||
|
||
// Provides a message for deprecation | ||
string deprecation_message = 3 [deprecated = true]; | ||
} | ||
|
||
extend google.protobuf.OneofOptions { | ||
ProtoktOneofOptions oneof = 1072 [deprecated = true]; | ||
} | ||
|
||
message ProtoktEnumOptions { | ||
option deprecated = true; | ||
|
||
// Provides a message for deprecation | ||
string deprecation_message = 1 [deprecated = true]; | ||
} | ||
|
||
extend google.protobuf.EnumOptions { | ||
ProtoktEnumOptions enum = 1072 [deprecated = true]; | ||
} | ||
|
||
message ProtoktEnumValueOptions { | ||
option deprecated = true; | ||
|
||
// Provides a message for deprecation | ||
string deprecation_message = 1 [deprecated = true]; | ||
} | ||
|
||
extend google.protobuf.EnumValueOptions { | ||
ProtoktEnumValueOptions enum_value = 1072 [deprecated = true]; | ||
} | ||
|
||
message ProtoktServiceOptions { | ||
option deprecated = true; | ||
} | ||
|
||
extend google.protobuf.ServiceOptions { | ||
ProtoktServiceOptions service = 1072 [deprecated = true]; | ||
} | ||
|
||
message ProtoktMethodOptions { | ||
option deprecated = true; | ||
|
||
// Provides a custom request marshaller for the generated method descriptor. | ||
// Substitutes the provided expression directly for | ||
// `com.toasttab.protokt.grpc.KtMarshaller(<request_type>)` | ||
string request_marshaller = 1 [deprecated = true]; | ||
|
||
// Provides a custom response marshaller for the generated method descriptor. | ||
// Substitutes the provided expression directly for | ||
// `com.toasttab.protokt.grpc.KtMarshaller(<response_type>)` | ||
string response_marshaller = 2 [deprecated = true]; | ||
} | ||
|
||
extend google.protobuf.MethodOptions { | ||
ProtoktMethodOptions method = 1072 [deprecated = true]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.