From 76b779aba620864b8c4ff4b21194a45eec0cd3ab Mon Sep 17 00:00:00 2001 From: Alexey Khokhlov Date: Mon, 18 Jun 2018 18:17:56 +0300 Subject: [PATCH] Format options --- .travis.yml | 1 + ProtocolBuffers-Swift.podspec | 2 +- Source/AbstractMessage.swift | 14 +- Source/Google.Protobuf.Any.proto.swift | 8 +- Source/Google.Protobuf.Api.proto.swift | 16 +- Source/Google.Protobuf.Descriptor.proto.swift | 348 +++++++---- Source/Google.Protobuf.Duration.proto.swift | 8 +- Source/Google.Protobuf.Empty.proto.swift | 8 +- Source/Google.Protobuf.FieldMask.proto.swift | 8 +- .../Google.Protobuf.SourceContext.proto.swift | 8 +- Source/Google.Protobuf.Struct.proto.swift | 32 +- ...oogle.Protobuf.SwiftDescriptor.proto.swift | 40 +- Source/Google.Protobuf.Timestamp.proto.swift | 8 +- Source/Google.Protobuf.Type.proto.swift | 40 +- Source/Google.Protobuf.Wrappers.proto.swift | 72 +-- plugin/Tests/Performance.proto.swift | 72 +-- plugin/Tests/pbTests/Bar.Foo.proto.swift | 8 +- plugin/Tests/pbTests/Baz.Foo.proto.swift | 8 +- ...Test.UnittestNoGenericServices.proto.swift | 8 +- ...buf.UnittestEnormousDescriptor.proto.swift | 8 +- ...to2ArenaUnittest.UnittestArena.proto.swift | 16 +- ...Unittest.UnittestNoArenaImport.proto.swift | 8 +- ...ittest.UnittestNoFieldPresence.proto.swift | 32 +- ...naUnittest.UnittestProto3Arena.proto.swift | 56 +- ...st.UnittestPreserveUnknownEnum.proto.swift | 16 +- .../ProtobufUnittest.Unittest.proto.swift | 576 +++++++++--------- ...Unittest.UnittestCustomOptions.proto.swift | 200 +++--- ...ttest.UnittestEmbedOptimizeFor.proto.swift | 8 +- .../ProtobufUnittest.UnittestLite.proto.swift | 160 ++--- ...est.UnittestLiteImportsNonlite.proto.swift | 8 +- .../ProtobufUnittest.UnittestMset.proto.swift | 48 +- ...ufUnittest.UnittestOptimizeFor.proto.swift | 24 +- ...nittest.UnittestWellKnownTypes.proto.swift | 8 +- ...fUnittestImport.UnittestImport.proto.swift | 8 +- ...ttestImport.UnittestImportLite.proto.swift | 8 +- ...estImport.UnittestImportPublic.proto.swift | 8 +- ...mport.UnittestImportPublicLite.proto.swift | 8 +- ...nittestNoArena.UnittestNoArena.proto.swift | 48 +- ...tProtobufUnittest.UnittestMaps.proto.swift | 64 +- ...elds.UnittestDropUnknownFields.proto.swift | 16 +- .../pbTests/UnittestErrorType.proto.swift | 32 +- .../Tests/pbTests/UnittestStruct.proto.swift | 8 +- .../pbTests/UnittestThreading.proto.swift | 8 +- .../compiler/google/protobuf/descriptor.pb.cc | 385 ++++++++---- .../compiler/google/protobuf/descriptor.pb.h | 298 +++++++-- plugin/compiler/swift_message.cc | 8 +- 46 files changed, 1631 insertions(+), 1145 deletions(-) diff --git a/.travis.yml b/.travis.yml index ada6483..f4fa0ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: objective-c osx_image: xcode9 before_install: + - brew update - brew install protobuf # - brew uninstall xctool # - brew install xctool --HEAD diff --git a/ProtocolBuffers-Swift.podspec b/ProtocolBuffers-Swift.podspec index e5c489a..51245e9 100644 --- a/ProtocolBuffers-Swift.podspec +++ b/ProtocolBuffers-Swift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "ProtocolBuffers-Swift" - s.version = "4.0.2" + s.version = "4.0.3" s.summary = "Protocol Buffers for Swift" s.homepage = "http://protobuf.io#swift" s.license = "Apache 2.0" diff --git a/Source/AbstractMessage.swift b/Source/AbstractMessage.swift index 06b667c..e7fd6fc 100644 --- a/Source/AbstractMessage.swift +++ b/Source/AbstractMessage.swift @@ -45,8 +45,8 @@ public protocol ProtocolBuffersMessage:ProtocolBuffersMessageInit { //JSON func encode() throws -> Dictionary static func decode(jsonMap:Dictionary) throws -> Self - func toJSON() throws -> Data - static func fromJSON(data:Data) throws -> Self + func toJSON(options: JSONSerialization.WritingOptions) throws -> Data + static func fromJSON(data:Data, options: JSONSerialization.ReadingOptions) throws -> Self } @@ -66,7 +66,7 @@ public protocol ProtocolBuffersMessageBuilder { func mergeDelimitedFrom(inputStream:InputStream) throws -> Self? static func decodeToBuilder(jsonMap:Dictionary) throws -> Self - static func fromJSONToBuilder(data:Data) throws -> Self + static func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions) throws -> Self } @@ -141,12 +141,12 @@ open class AbstractProtocolBuffersMessage:Hashable, ProtocolBuffersMessage { throw ProtocolBuffersError.obvious("JSON Encoding/Decoding available only in syntax=\"proto3\"") } - open func toJSON() throws -> Data { - let json = try JSONSerialization.data(withJSONObject: encode()) + open func toJSON(options: JSONSerialization.WritingOptions = []) throws -> Data { + let json = try JSONSerialization.data(withJSONObject: encode(), options:options) return json } - open class func fromJSON(data:Data) throws -> Self { + open class func fromJSON(data:Data, options: JSONSerialization.ReadingOptions) throws -> Self { throw ProtocolBuffersError.obvious("JSON Encoding/Decoding available only in syntax=\"proto3\"") } @@ -238,7 +238,7 @@ open class AbstractProtocolBuffersMessageBuilder:ProtocolBuffersMessageBuilder { throw ProtocolBuffersError.obvious("JSON Encoding/Decoding available only in syntax=\"proto3\"") } - open class func fromJSONToBuilder(data: Data) throws -> Self { + open class func fromJSONToBuilder(data: Data, options: JSONSerialization.ReadingOptions = []) throws -> Self { throw ProtocolBuffersError.obvious("JSON Encoding/Decoding available only in syntax=\"proto3\"") } diff --git a/Source/Google.Protobuf.Any.proto.swift b/Source/Google.Protobuf.Any.proto.swift index e5496b7..a24cccb 100644 --- a/Source/Google.Protobuf.Any.proto.swift +++ b/Source/Google.Protobuf.Any.proto.swift @@ -151,8 +151,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.`Any` { return try Google.Protobuf.`Any`.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.`Any` { - return try Google.Protobuf.`Any`.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.`Any` { + return try Google.Protobuf.`Any`.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -343,8 +343,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.`Any`.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.`Any`.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/Source/Google.Protobuf.Api.proto.swift b/Source/Google.Protobuf.Api.proto.swift index c5383f4..af5f97e 100644 --- a/Source/Google.Protobuf.Api.proto.swift +++ b/Source/Google.Protobuf.Api.proto.swift @@ -174,8 +174,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.Api { return try Google.Protobuf.Api.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.Api { - return try Google.Protobuf.Api.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Api { + return try Google.Protobuf.Api.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -541,8 +541,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Api.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Api.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -696,8 +696,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.Method { return try Google.Protobuf.Method.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.Method { - return try Google.Protobuf.Method.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Method { + return try Google.Protobuf.Method.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1038,8 +1038,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Method.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Method.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/Source/Google.Protobuf.Descriptor.proto.swift b/Source/Google.Protobuf.Descriptor.proto.swift index dfe5245..86cc21d 100644 --- a/Source/Google.Protobuf.Descriptor.proto.swift +++ b/Source/Google.Protobuf.Descriptor.proto.swift @@ -98,8 +98,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.FileDescriptorSet { return try Google.Protobuf.FileDescriptorSet.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.FileDescriptorSet { - return try Google.Protobuf.FileDescriptorSet.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.FileDescriptorSet { + return try Google.Protobuf.FileDescriptorSet.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -234,8 +234,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.FileDescriptorSet.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.FileDescriptorSet.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -517,8 +517,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.FileDescriptorProto { return try Google.Protobuf.FileDescriptorProto.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.FileDescriptorProto { - return try Google.Protobuf.FileDescriptorProto.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.FileDescriptorProto { + return try Google.Protobuf.FileDescriptorProto.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1200,8 +1200,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.FileDescriptorProto.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.FileDescriptorProto.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1338,8 +1338,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.DescriptorProto.ExtensionRange { return try Google.Protobuf.DescriptorProto.ExtensionRange.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.DescriptorProto.ExtensionRange { - return try Google.Protobuf.DescriptorProto.ExtensionRange.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.DescriptorProto.ExtensionRange { + return try Google.Protobuf.DescriptorProto.ExtensionRange.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1594,8 +1594,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.DescriptorProto.ExtensionRange.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.DescriptorProto.ExtensionRange.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1699,8 +1699,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.DescriptorProto.ReservedRange { return try Google.Protobuf.DescriptorProto.ReservedRange.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.DescriptorProto.ReservedRange { - return try Google.Protobuf.DescriptorProto.ReservedRange.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.DescriptorProto.ReservedRange { + return try Google.Protobuf.DescriptorProto.ReservedRange.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1876,8 +1876,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.DescriptorProto.ReservedRange.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.DescriptorProto.ReservedRange.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -2106,8 +2106,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.DescriptorProto { return try Google.Protobuf.DescriptorProto.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.DescriptorProto { - return try Google.Protobuf.DescriptorProto.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.DescriptorProto { + return try Google.Protobuf.DescriptorProto.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -2674,8 +2674,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.DescriptorProto.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.DescriptorProto.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -2764,8 +2764,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.ExtensionRangeOptions { return try Google.Protobuf.ExtensionRangeOptions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.ExtensionRangeOptions { - return try Google.Protobuf.ExtensionRangeOptions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.ExtensionRangeOptions { + return try Google.Protobuf.ExtensionRangeOptions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -2904,8 +2904,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.ExtensionRangeOptions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.ExtensionRangeOptions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -3289,8 +3289,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.FieldDescriptorProto { return try Google.Protobuf.FieldDescriptorProto.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.FieldDescriptorProto { - return try Google.Protobuf.FieldDescriptorProto.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.FieldDescriptorProto { + return try Google.Protobuf.FieldDescriptorProto.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -3855,8 +3855,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.FieldDescriptorProto.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.FieldDescriptorProto.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -3954,8 +3954,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.OneofDescriptorProto { return try Google.Protobuf.OneofDescriptorProto.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.OneofDescriptorProto { - return try Google.Protobuf.OneofDescriptorProto.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.OneofDescriptorProto { + return try Google.Protobuf.OneofDescriptorProto.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -4166,8 +4166,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.OneofDescriptorProto.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.OneofDescriptorProto.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -4289,8 +4289,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.EnumDescriptorProto.EnumReservedRange { return try Google.Protobuf.EnumDescriptorProto.EnumReservedRange.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.EnumDescriptorProto.EnumReservedRange { - return try Google.Protobuf.EnumDescriptorProto.EnumReservedRange.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.EnumDescriptorProto.EnumReservedRange { + return try Google.Protobuf.EnumDescriptorProto.EnumReservedRange.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -4466,8 +4466,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.EnumDescriptorProto.EnumReservedRange.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.EnumDescriptorProto.EnumReservedRange.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -4606,8 +4606,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.EnumDescriptorProto { return try Google.Protobuf.EnumDescriptorProto.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.EnumDescriptorProto { - return try Google.Protobuf.EnumDescriptorProto.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.EnumDescriptorProto { + return try Google.Protobuf.EnumDescriptorProto.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -4952,8 +4952,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.EnumDescriptorProto.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.EnumDescriptorProto.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -5064,8 +5064,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.EnumValueDescriptorProto { return try Google.Protobuf.EnumValueDescriptorProto.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.EnumValueDescriptorProto { - return try Google.Protobuf.EnumValueDescriptorProto.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.EnumValueDescriptorProto { + return try Google.Protobuf.EnumValueDescriptorProto.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -5318,8 +5318,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.EnumValueDescriptorProto.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.EnumValueDescriptorProto.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -5436,8 +5436,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.ServiceDescriptorProto { return try Google.Protobuf.ServiceDescriptorProto.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.ServiceDescriptorProto { - return try Google.Protobuf.ServiceDescriptorProto.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.ServiceDescriptorProto { + return try Google.Protobuf.ServiceDescriptorProto.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -5693,8 +5693,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.ServiceDescriptorProto.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.ServiceDescriptorProto.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -5848,8 +5848,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.MethodDescriptorProto { return try Google.Protobuf.MethodDescriptorProto.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.MethodDescriptorProto { - return try Google.Protobuf.MethodDescriptorProto.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.MethodDescriptorProto { + return try Google.Protobuf.MethodDescriptorProto.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -6224,8 +6224,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.MethodDescriptorProto.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.MethodDescriptorProto.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -6261,6 +6261,8 @@ public extension Google.Protobuf { fieldCheck = fieldCheck && (lhs.hasPhpClassPrefix == rhs.hasPhpClassPrefix) && (!lhs.hasPhpClassPrefix || lhs.phpClassPrefix == rhs.phpClassPrefix) fieldCheck = fieldCheck && (lhs.hasPhpNamespace == rhs.hasPhpNamespace) && (!lhs.hasPhpNamespace || lhs.phpNamespace == rhs.phpNamespace) fieldCheck = fieldCheck && (lhs.hasPhpGenericServices == rhs.hasPhpGenericServices) && (!lhs.hasPhpGenericServices || lhs.phpGenericServices == rhs.phpGenericServices) + fieldCheck = fieldCheck && (lhs.hasPhpMetadataNamespace == rhs.hasPhpMetadataNamespace) && (!lhs.hasPhpMetadataNamespace || lhs.phpMetadataNamespace == rhs.phpMetadataNamespace) + fieldCheck = fieldCheck && (lhs.hasRubyPackage == rhs.hasRubyPackage) && (!lhs.hasRubyPackage || lhs.rubyPackage == rhs.rubyPackage) fieldCheck = fieldCheck && (lhs.uninterpretedOption == rhs.uninterpretedOption) fieldCheck = fieldCheck && lhs.isEqualExtensionsInOther(otherMessage: rhs, startInclusive:1000, endExclusive:536870912) fieldCheck = (fieldCheck && (lhs.unknownFields == rhs.unknownFields)) @@ -6422,6 +6424,18 @@ public extension Google.Protobuf { public fileprivate(set) var phpNamespace:String! = nil public fileprivate(set) var hasPhpNamespace:Bool = false + /// Use this option to change the namespace of php generated metadata classes. + /// Default is empty. When this option is empty, the proto file name will be used + /// for determining the namespace. + public fileprivate(set) var phpMetadataNamespace:String! = nil + public fileprivate(set) var hasPhpMetadataNamespace:Bool = false + + /// Use this option to change the package of ruby generated classes. Default + /// is empty. When this option is not set, the package name will be used for + /// determining the ruby package. + public fileprivate(set) var rubyPackage:String! = nil + public fileprivate(set) var hasRubyPackage:Bool = false + public fileprivate(set) var uninterpretedOption:Array = Array() required public init() { super.init() @@ -6486,6 +6500,12 @@ public extension Google.Protobuf { if hasPhpGenericServices { try codedOutputStream.writeBool(fieldNumber: 42, value:phpGenericServices) } + if hasPhpMetadataNamespace { + try codedOutputStream.writeString(fieldNumber: 44, value:phpMetadataNamespace) + } + if hasRubyPackage { + try codedOutputStream.writeString(fieldNumber: 45, value:rubyPackage) + } for oneElementUninterpretedOption in uninterpretedOption { try codedOutputStream.writeMessage(fieldNumber: 999, value:oneElementUninterpretedOption) } @@ -6553,6 +6573,12 @@ public extension Google.Protobuf { if hasPhpGenericServices { serialize_size += phpGenericServices.computeBoolSize(fieldNumber: 42) } + if hasPhpMetadataNamespace { + serialize_size += phpMetadataNamespace.computeStringSize(fieldNumber: 44) + } + if hasRubyPackage { + serialize_size += rubyPackage.computeStringSize(fieldNumber: 45) + } for oneElementUninterpretedOption in uninterpretedOption { serialize_size += oneElementUninterpretedOption.computeMessageSize(fieldNumber: 999) } @@ -6636,6 +6662,12 @@ public extension Google.Protobuf { if hasPhpNamespace { jsonMap["phpNamespace"] = phpNamespace } + if hasPhpMetadataNamespace { + jsonMap["phpMetadataNamespace"] = phpMetadataNamespace + } + if hasRubyPackage { + jsonMap["rubyPackage"] = rubyPackage + } if !uninterpretedOption.isEmpty { var jsonArrayUninterpretedOption:Array> = [] for oneValueUninterpretedOption in uninterpretedOption { @@ -6649,8 +6681,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.FileOptions { return try Google.Protobuf.FileOptions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.FileOptions { - return try Google.Protobuf.FileOptions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.FileOptions { + return try Google.Protobuf.FileOptions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -6708,6 +6740,12 @@ public extension Google.Protobuf { if hasPhpGenericServices { output += "\(indent) phpGenericServices: \(phpGenericServices) \n" } + if hasPhpMetadataNamespace { + output += "\(indent) phpMetadataNamespace: \(phpMetadataNamespace) \n" + } + if hasRubyPackage { + output += "\(indent) rubyPackage: \(rubyPackage) \n" + } var uninterpretedOptionElementIndex:Int = 0 for oneElementUninterpretedOption in uninterpretedOption { output += "\(indent) uninterpretedOption[\(uninterpretedOptionElementIndex)] {\n" @@ -6776,6 +6814,12 @@ public extension Google.Protobuf { if hasPhpGenericServices { hashCode = (hashCode &* 31) &+ phpGenericServices.hashValue } + if hasPhpMetadataNamespace { + hashCode = (hashCode &* 31) &+ phpMetadataNamespace.hashValue + } + if hasRubyPackage { + hashCode = (hashCode &* 31) &+ rubyPackage.hashValue + } for oneElementUninterpretedOption in uninterpretedOption { hashCode = (hashCode &* 31) &+ oneElementUninterpretedOption.hashValue } @@ -7309,6 +7353,62 @@ public extension Google.Protobuf { builderResult.phpNamespace = nil return self } + /// Use this option to change the namespace of php generated metadata classes. + /// Default is empty. When this option is empty, the proto file name will be used + /// for determining the namespace. + public var phpMetadataNamespace:String { + get { + return builderResult.phpMetadataNamespace + } + set (value) { + builderResult.hasPhpMetadataNamespace = true + builderResult.phpMetadataNamespace = value + } + } + public var hasPhpMetadataNamespace:Bool { + get { + return builderResult.hasPhpMetadataNamespace + } + } + @discardableResult + public func setPhpMetadataNamespace(_ value:String) -> Google.Protobuf.FileOptions.Builder { + self.phpMetadataNamespace = value + return self + } + @discardableResult + public func clearPhpMetadataNamespace() -> Google.Protobuf.FileOptions.Builder{ + builderResult.hasPhpMetadataNamespace = false + builderResult.phpMetadataNamespace = nil + return self + } + /// Use this option to change the package of ruby generated classes. Default + /// is empty. When this option is not set, the package name will be used for + /// determining the ruby package. + public var rubyPackage:String { + get { + return builderResult.rubyPackage + } + set (value) { + builderResult.hasRubyPackage = true + builderResult.rubyPackage = value + } + } + public var hasRubyPackage:Bool { + get { + return builderResult.hasRubyPackage + } + } + @discardableResult + public func setRubyPackage(_ value:String) -> Google.Protobuf.FileOptions.Builder { + self.rubyPackage = value + return self + } + @discardableResult + public func clearRubyPackage() -> Google.Protobuf.FileOptions.Builder{ + builderResult.hasRubyPackage = false + builderResult.rubyPackage = nil + return self + } /// The parser stores options it doesn't recognize here. /// See the documentation for the "Options" section above. public var uninterpretedOption:Array { @@ -7409,6 +7509,12 @@ public extension Google.Protobuf { if other.hasPhpNamespace { phpNamespace = other.phpNamespace } + if other.hasPhpMetadataNamespace { + phpMetadataNamespace = other.phpMetadataNamespace + } + if other.hasRubyPackage { + rubyPackage = other.rubyPackage + } if !other.uninterpretedOption.isEmpty { builderResult.uninterpretedOption += other.uninterpretedOption } @@ -7489,6 +7595,12 @@ public extension Google.Protobuf { case 336: phpGenericServices = try codedInputStream.readBool() + case 354: + phpMetadataNamespace = try codedInputStream.readString() + + case 362: + rubyPackage = try codedInputStream.readString() + case 7994: let subBuilder = Google.Protobuf.UninterpretedOption.Builder() try codedInputStream.readMessage(builder: subBuilder,extensionRegistry:extensionRegistry) @@ -7558,6 +7670,12 @@ public extension Google.Protobuf { if let jsonValuePhpNamespace = jsonMap["phpNamespace"] as? String { resultDecodedBuilder.phpNamespace = jsonValuePhpNamespace } + if let jsonValuePhpMetadataNamespace = jsonMap["phpMetadataNamespace"] as? String { + resultDecodedBuilder.phpMetadataNamespace = jsonValuePhpMetadataNamespace + } + if let jsonValueRubyPackage = jsonMap["rubyPackage"] as? String { + resultDecodedBuilder.rubyPackage = jsonValueRubyPackage + } if let jsonValueUninterpretedOption = jsonMap["uninterpretedOption"] as? Array> { var jsonArrayUninterpretedOption:Array = [] for oneValueUninterpretedOption in jsonValueUninterpretedOption { @@ -7569,8 +7687,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.FileOptions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.FileOptions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -7751,8 +7869,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.MessageOptions { return try Google.Protobuf.MessageOptions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.MessageOptions { - return try Google.Protobuf.MessageOptions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.MessageOptions { + return try Google.Protobuf.MessageOptions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -8091,8 +8209,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.MessageOptions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.MessageOptions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -8381,8 +8499,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.FieldOptions { return try Google.Protobuf.FieldOptions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.FieldOptions { - return try Google.Protobuf.FieldOptions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.FieldOptions { + return try Google.Protobuf.FieldOptions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -8819,8 +8937,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.FieldOptions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.FieldOptions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -8909,8 +9027,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.OneofOptions { return try Google.Protobuf.OneofOptions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.OneofOptions { - return try Google.Protobuf.OneofOptions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.OneofOptions { + return try Google.Protobuf.OneofOptions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -9049,8 +9167,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.OneofOptions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.OneofOptions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -9171,8 +9289,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.EnumOptions { return try Google.Protobuf.EnumOptions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.EnumOptions { - return try Google.Protobuf.EnumOptions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.EnumOptions { + return try Google.Protobuf.EnumOptions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -9397,8 +9515,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.EnumOptions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.EnumOptions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -9504,8 +9622,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.EnumValueOptions { return try Google.Protobuf.EnumValueOptions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.EnumValueOptions { - return try Google.Protobuf.EnumValueOptions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.EnumValueOptions { + return try Google.Protobuf.EnumValueOptions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -9688,8 +9806,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.EnumValueOptions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.EnumValueOptions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -9795,8 +9913,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.ServiceOptions { return try Google.Protobuf.ServiceOptions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.ServiceOptions { - return try Google.Protobuf.ServiceOptions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.ServiceOptions { + return try Google.Protobuf.ServiceOptions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -9979,8 +10097,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.ServiceOptions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.ServiceOptions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -10147,8 +10265,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.MethodOptions { return try Google.Protobuf.MethodOptions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.MethodOptions { - return try Google.Protobuf.MethodOptions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.MethodOptions { + return try Google.Protobuf.MethodOptions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -10376,8 +10494,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.MethodOptions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.MethodOptions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -10510,8 +10628,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.UninterpretedOption.NamePart { return try Google.Protobuf.UninterpretedOption.NamePart.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.UninterpretedOption.NamePart { - return try Google.Protobuf.UninterpretedOption.NamePart.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.UninterpretedOption.NamePart { + return try Google.Protobuf.UninterpretedOption.NamePart.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -10681,8 +10799,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.UninterpretedOption.NamePart.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.UninterpretedOption.NamePart.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -10831,8 +10949,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.UninterpretedOption { return try Google.Protobuf.UninterpretedOption.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.UninterpretedOption { - return try Google.Protobuf.UninterpretedOption.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.UninterpretedOption { + return try Google.Protobuf.UninterpretedOption.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -11215,8 +11333,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.UninterpretedOption.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.UninterpretedOption.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -11464,8 +11582,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.SourceCodeInfo.Location { return try Google.Protobuf.SourceCodeInfo.Location.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.SourceCodeInfo.Location { - return try Google.Protobuf.SourceCodeInfo.Location.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.SourceCodeInfo.Location { + return try Google.Protobuf.SourceCodeInfo.Location.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -11824,8 +11942,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.SourceCodeInfo.Location.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.SourceCodeInfo.Location.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -11897,8 +12015,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.SourceCodeInfo { return try Google.Protobuf.SourceCodeInfo.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.SourceCodeInfo { - return try Google.Protobuf.SourceCodeInfo.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.SourceCodeInfo { + return try Google.Protobuf.SourceCodeInfo.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -12074,8 +12192,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.SourceCodeInfo.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.SourceCodeInfo.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -12236,8 +12354,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.GeneratedCodeInfo.Annotation { return try Google.Protobuf.GeneratedCodeInfo.Annotation.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.GeneratedCodeInfo.Annotation { - return try Google.Protobuf.GeneratedCodeInfo.Annotation.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.GeneratedCodeInfo.Annotation { + return try Google.Protobuf.GeneratedCodeInfo.Annotation.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -12503,8 +12621,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.GeneratedCodeInfo.Annotation.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.GeneratedCodeInfo.Annotation.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -12576,8 +12694,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.GeneratedCodeInfo { return try Google.Protobuf.GeneratedCodeInfo.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.GeneratedCodeInfo { - return try Google.Protobuf.GeneratedCodeInfo.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.GeneratedCodeInfo { + return try Google.Protobuf.GeneratedCodeInfo.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -12714,8 +12832,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.GeneratedCodeInfo.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.GeneratedCodeInfo.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -13845,6 +13963,8 @@ extension Google.Protobuf.FileOptions: GeneratedMessageProtocol { case "swiftPrefix": return self.swiftPrefix case "phpClassPrefix": return self.phpClassPrefix case "phpNamespace": return self.phpNamespace + case "phpMetadataNamespace": return self.phpMetadataNamespace + case "rubyPackage": return self.rubyPackage case "uninterpretedOption": return self.uninterpretedOption default: return nil } @@ -13873,6 +13993,8 @@ extension Google.Protobuf.FileOptions.Builder: GeneratedMessageBuilderProtocol { case "swiftPrefix": return self.swiftPrefix case "phpClassPrefix": return self.phpClassPrefix case "phpNamespace": return self.phpNamespace + case "phpMetadataNamespace": return self.phpMetadataNamespace + case "rubyPackage": return self.rubyPackage case "uninterpretedOption": return self.uninterpretedOption default: return nil } @@ -13969,6 +14091,16 @@ extension Google.Protobuf.FileOptions.Builder: GeneratedMessageBuilderProtocol { return } self.phpNamespace = newSubscriptValue + case "phpMetadataNamespace": + guard let newSubscriptValue = newSubscriptValue as? String else { + return + } + self.phpMetadataNamespace = newSubscriptValue + case "rubyPackage": + guard let newSubscriptValue = newSubscriptValue as? String else { + return + } + self.rubyPackage = newSubscriptValue case "uninterpretedOption": guard let newSubscriptValue = newSubscriptValue as? Array else { return diff --git a/Source/Google.Protobuf.Duration.proto.swift b/Source/Google.Protobuf.Duration.proto.swift index 2ebe9bf..6518bf6 100644 --- a/Source/Google.Protobuf.Duration.proto.swift +++ b/Source/Google.Protobuf.Duration.proto.swift @@ -144,8 +144,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.Duration { return try Google.Protobuf.Duration.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.Duration { - return try Google.Protobuf.Duration.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Duration { + return try Google.Protobuf.Duration.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -327,8 +327,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Duration.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Duration.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/Source/Google.Protobuf.Empty.proto.swift b/Source/Google.Protobuf.Empty.proto.swift index 6d3d474..cfd34b5 100644 --- a/Source/Google.Protobuf.Empty.proto.swift +++ b/Source/Google.Protobuf.Empty.proto.swift @@ -84,8 +84,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.Empty { return try Google.Protobuf.Empty.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.Empty { - return try Google.Protobuf.Empty.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Empty { + return try Google.Protobuf.Empty.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -175,8 +175,8 @@ public extension Google.Protobuf { let resultDecodedBuilder = Google.Protobuf.Empty.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Empty.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Empty.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/Source/Google.Protobuf.FieldMask.proto.swift b/Source/Google.Protobuf.FieldMask.proto.swift index 000c0f3..9494284 100644 --- a/Source/Google.Protobuf.FieldMask.proto.swift +++ b/Source/Google.Protobuf.FieldMask.proto.swift @@ -194,8 +194,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.FieldMask { return try Google.Protobuf.FieldMask.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.FieldMask { - return try Google.Protobuf.FieldMask.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.FieldMask { + return try Google.Protobuf.FieldMask.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -325,8 +325,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.FieldMask.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.FieldMask.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/Source/Google.Protobuf.SourceContext.proto.swift b/Source/Google.Protobuf.SourceContext.proto.swift index 7f7a126..4def921 100644 --- a/Source/Google.Protobuf.SourceContext.proto.swift +++ b/Source/Google.Protobuf.SourceContext.proto.swift @@ -95,8 +95,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.SourceContext { return try Google.Protobuf.SourceContext.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.SourceContext { - return try Google.Protobuf.SourceContext.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.SourceContext { + return try Google.Protobuf.SourceContext.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -228,8 +228,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.SourceContext.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.SourceContext.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/Source/Google.Protobuf.Struct.proto.swift b/Source/Google.Protobuf.Struct.proto.swift index 97efaa8..28c2af7 100644 --- a/Source/Google.Protobuf.Struct.proto.swift +++ b/Source/Google.Protobuf.Struct.proto.swift @@ -165,8 +165,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.Struct.FieldsEntry { return try Google.Protobuf.Struct.FieldsEntry.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.Struct.FieldsEntry { - return try Google.Protobuf.Struct.FieldsEntry.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Struct.FieldsEntry { + return try Google.Protobuf.Struct.FieldsEntry.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -377,8 +377,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Struct.FieldsEntry.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Struct.FieldsEntry.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -458,8 +458,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.Struct { return try Google.Protobuf.Struct.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.Struct { - return try Google.Protobuf.Struct.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Struct { + return try Google.Protobuf.Struct.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -601,8 +601,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Struct.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Struct.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -935,8 +935,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.Value { return try Google.Protobuf.Value.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.Value { - return try Google.Protobuf.Value.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Value { + return try Google.Protobuf.Value.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1365,8 +1365,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Value.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Value.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1450,8 +1450,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.ListValue { return try Google.Protobuf.ListValue.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.ListValue { - return try Google.Protobuf.ListValue.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.ListValue { + return try Google.Protobuf.ListValue.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1587,8 +1587,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.ListValue.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.ListValue.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/Source/Google.Protobuf.SwiftDescriptor.proto.swift b/Source/Google.Protobuf.SwiftDescriptor.proto.swift index ab15369..5204832 100644 --- a/Source/Google.Protobuf.SwiftDescriptor.proto.swift +++ b/Source/Google.Protobuf.SwiftDescriptor.proto.swift @@ -246,8 +246,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.LinkedObject { return try Google.Protobuf.LinkedObject.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.LinkedObject { - return try Google.Protobuf.LinkedObject.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.LinkedObject { + return try Google.Protobuf.LinkedObject.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -457,8 +457,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.LinkedObject.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.LinkedObject.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -602,8 +602,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.SwiftFileOptions { return try Google.Protobuf.SwiftFileOptions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.SwiftFileOptions { - return try Google.Protobuf.SwiftFileOptions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.SwiftFileOptions { + return try Google.Protobuf.SwiftFileOptions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -938,8 +938,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.SwiftFileOptions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.SwiftFileOptions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1077,8 +1077,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.SwiftMessageOptions { return try Google.Protobuf.SwiftMessageOptions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.SwiftMessageOptions { - return try Google.Protobuf.SwiftMessageOptions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.SwiftMessageOptions { + return try Google.Protobuf.SwiftMessageOptions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1373,8 +1373,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.SwiftMessageOptions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.SwiftMessageOptions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1479,8 +1479,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.SwiftFieldOptions { return try Google.Protobuf.SwiftFieldOptions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.SwiftFieldOptions { - return try Google.Protobuf.SwiftFieldOptions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.SwiftFieldOptions { + return try Google.Protobuf.SwiftFieldOptions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1695,8 +1695,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.SwiftFieldOptions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.SwiftFieldOptions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1802,8 +1802,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.SwiftEnumOptions { return try Google.Protobuf.SwiftEnumOptions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.SwiftEnumOptions { - return try Google.Protobuf.SwiftEnumOptions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.SwiftEnumOptions { + return try Google.Protobuf.SwiftEnumOptions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -2013,8 +2013,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.SwiftEnumOptions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.SwiftEnumOptions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/Source/Google.Protobuf.Timestamp.proto.swift b/Source/Google.Protobuf.Timestamp.proto.swift index 267942c..c1871fc 100644 --- a/Source/Google.Protobuf.Timestamp.proto.swift +++ b/Source/Google.Protobuf.Timestamp.proto.swift @@ -150,8 +150,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.Timestamp { return try Google.Protobuf.Timestamp.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.Timestamp { - return try Google.Protobuf.Timestamp.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Timestamp { + return try Google.Protobuf.Timestamp.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -332,8 +332,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Timestamp.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Timestamp.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/Source/Google.Protobuf.Type.proto.swift b/Source/Google.Protobuf.Type.proto.swift index 198ee61..1644cb7 100644 --- a/Source/Google.Protobuf.Type.proto.swift +++ b/Source/Google.Protobuf.Type.proto.swift @@ -163,8 +163,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.ProtoType { return try Google.Protobuf.ProtoType.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.ProtoType { - return try Google.Protobuf.ProtoType.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.ProtoType { + return try Google.Protobuf.ProtoType.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -510,8 +510,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.ProtoType.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.ProtoType.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -883,8 +883,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.Field { return try Google.Protobuf.Field.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.Field { - return try Google.Protobuf.Field.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Field { + return try Google.Protobuf.Field.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1322,8 +1322,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Field.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Field.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1451,8 +1451,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.Enum { return try Google.Protobuf.Enum.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.Enum { - return try Google.Protobuf.Enum.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Enum { + return try Google.Protobuf.Enum.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1757,8 +1757,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Enum.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Enum.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1870,8 +1870,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.EnumValue { return try Google.Protobuf.EnumValue.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.EnumValue { - return try Google.Protobuf.EnumValue.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.EnumValue { + return try Google.Protobuf.EnumValue.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -2091,8 +2091,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.EnumValue.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.EnumValue.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -2188,8 +2188,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.Option { return try Google.Protobuf.Option.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.Option { - return try Google.Protobuf.Option.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Option { + return try Google.Protobuf.Option.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -2402,8 +2402,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Option.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Option.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/Source/Google.Protobuf.Wrappers.proto.swift b/Source/Google.Protobuf.Wrappers.proto.swift index 68367d0..61162cb 100644 --- a/Source/Google.Protobuf.Wrappers.proto.swift +++ b/Source/Google.Protobuf.Wrappers.proto.swift @@ -93,8 +93,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.DoubleValue { return try Google.Protobuf.DoubleValue.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.DoubleValue { - return try Google.Protobuf.DoubleValue.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.DoubleValue { + return try Google.Protobuf.DoubleValue.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -227,8 +227,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.DoubleValue.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.DoubleValue.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -310,8 +310,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.FloatValue { return try Google.Protobuf.FloatValue.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.FloatValue { - return try Google.Protobuf.FloatValue.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.FloatValue { + return try Google.Protobuf.FloatValue.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -444,8 +444,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.FloatValue.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.FloatValue.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -527,8 +527,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.Int64Value { return try Google.Protobuf.Int64Value.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.Int64Value { - return try Google.Protobuf.Int64Value.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Int64Value { + return try Google.Protobuf.Int64Value.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -661,8 +661,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Int64Value.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Int64Value.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -744,8 +744,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.Uint64Value { return try Google.Protobuf.Uint64Value.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.Uint64Value { - return try Google.Protobuf.Uint64Value.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Uint64Value { + return try Google.Protobuf.Uint64Value.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -878,8 +878,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Uint64Value.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Uint64Value.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -961,8 +961,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.Int32Value { return try Google.Protobuf.Int32Value.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.Int32Value { - return try Google.Protobuf.Int32Value.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Int32Value { + return try Google.Protobuf.Int32Value.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1095,8 +1095,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Int32Value.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Int32Value.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1178,8 +1178,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.Uint32Value { return try Google.Protobuf.Uint32Value.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.Uint32Value { - return try Google.Protobuf.Uint32Value.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Uint32Value { + return try Google.Protobuf.Uint32Value.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1312,8 +1312,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.Uint32Value.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.Uint32Value.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1395,8 +1395,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.BoolValue { return try Google.Protobuf.BoolValue.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.BoolValue { - return try Google.Protobuf.BoolValue.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.BoolValue { + return try Google.Protobuf.BoolValue.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1527,8 +1527,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.BoolValue.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.BoolValue.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1610,8 +1610,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.StringValue { return try Google.Protobuf.StringValue.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.StringValue { - return try Google.Protobuf.StringValue.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.StringValue { + return try Google.Protobuf.StringValue.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1742,8 +1742,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.StringValue.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.StringValue.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1825,8 +1825,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.BytesValue { return try Google.Protobuf.BytesValue.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.BytesValue { - return try Google.Protobuf.BytesValue.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.BytesValue { + return try Google.Protobuf.BytesValue.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1957,8 +1957,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.BytesValue.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.BytesValue.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/Performance.proto.swift b/plugin/Tests/Performance.proto.swift index 81c43df..9c2e104 100644 --- a/plugin/Tests/Performance.proto.swift +++ b/plugin/Tests/Performance.proto.swift @@ -104,8 +104,8 @@ final internal class PBUser : GeneratedMessage { override class internal func decode(jsonMap:Dictionary) throws -> PBUser { return try PBUser.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class internal func fromJSON(data:Data) throws -> PBUser { - return try PBUser.Builder.fromJSONToBuilder(data:data).build() + override class internal func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBUser { + return try PBUser.Builder.fromJSONToBuilder(data:data, options:options).build() } override internal func getDescription(indent:String) throws -> String { var output = "" @@ -316,8 +316,8 @@ final internal class PBUser : GeneratedMessage { } return resultDecodedBuilder } - override class internal func fromJSONToBuilder(data:Data) throws -> PBUser.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class internal func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBUser.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -398,8 +398,8 @@ final internal class PBGroup : GeneratedMessage { override class internal func decode(jsonMap:Dictionary) throws -> PBGroup { return try PBGroup.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class internal func fromJSON(data:Data) throws -> PBGroup { - return try PBGroup.Builder.fromJSONToBuilder(data:data).build() + override class internal func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBGroup { + return try PBGroup.Builder.fromJSONToBuilder(data:data, options:options).build() } override internal func getDescription(indent:String) throws -> String { var output = "" @@ -570,8 +570,8 @@ final internal class PBGroup : GeneratedMessage { } return resultDecodedBuilder } - override class internal func fromJSONToBuilder(data:Data) throws -> PBGroup.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class internal func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBGroup.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -657,8 +657,8 @@ final internal class PBPerfomanceBatch : GeneratedMessage { override class internal func decode(jsonMap:Dictionary) throws -> PBPerfomanceBatch { return try PBPerfomanceBatch.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class internal func fromJSON(data:Data) throws -> PBPerfomanceBatch { - return try PBPerfomanceBatch.Builder.fromJSONToBuilder(data:data).build() + override class internal func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBPerfomanceBatch { + return try PBPerfomanceBatch.Builder.fromJSONToBuilder(data:data, options:options).build() } override internal func getDescription(indent:String) throws -> String { var output = "" @@ -793,8 +793,8 @@ final internal class PBPerfomanceBatch : GeneratedMessage { } return resultDecodedBuilder } - override class internal func fromJSONToBuilder(data:Data) throws -> PBPerfomanceBatch.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class internal func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBPerfomanceBatch.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -964,8 +964,8 @@ final internal class PBPerfomance : GeneratedMessage { override class internal func decode(jsonMap:Dictionary) throws -> PBPerfomance { return try PBPerfomance.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class internal func fromJSON(data:Data) throws -> PBPerfomance { - return try PBPerfomance.Builder.fromJSONToBuilder(data:data).build() + override class internal func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBPerfomance { + return try PBPerfomance.Builder.fromJSONToBuilder(data:data, options:options).build() } override internal func getDescription(indent:String) throws -> String { var output = "" @@ -1343,8 +1343,8 @@ final internal class PBPerfomance : GeneratedMessage { } return resultDecodedBuilder } - override class internal func fromJSONToBuilder(data:Data) throws -> PBPerfomance.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class internal func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBPerfomance.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1443,8 +1443,8 @@ final internal class PBProtoPoint : GeneratedMessage { override class internal func decode(jsonMap:Dictionary) throws -> PBProtoPoint { return try PBProtoPoint.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class internal func fromJSON(data:Data) throws -> PBProtoPoint { - return try PBProtoPoint.Builder.fromJSONToBuilder(data:data).build() + override class internal func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBProtoPoint { + return try PBProtoPoint.Builder.fromJSONToBuilder(data:data, options:options).build() } override internal func getDescription(indent:String) throws -> String { var output = "" @@ -1618,8 +1618,8 @@ final internal class PBProtoPoint : GeneratedMessage { } return resultDecodedBuilder } - override class internal func fromJSONToBuilder(data:Data) throws -> PBProtoPoint.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class internal func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBProtoPoint.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1749,8 +1749,8 @@ final internal class PBIceCreamCone : GeneratedMessage { override class internal func decode(jsonMap:Dictionary) throws -> PBIceCreamCone { return try PBIceCreamCone.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class internal func fromJSON(data:Data) throws -> PBIceCreamCone { - return try PBIceCreamCone.Builder.fromJSONToBuilder(data:data).build() + override class internal func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBIceCreamCone { + return try PBIceCreamCone.Builder.fromJSONToBuilder(data:data, options:options).build() } override internal func getDescription(indent:String) throws -> String { var output = "" @@ -1927,8 +1927,8 @@ final internal class PBIceCreamCone : GeneratedMessage { } return resultDecodedBuilder } - override class internal func fromJSONToBuilder(data:Data) throws -> PBIceCreamCone.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class internal func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBIceCreamCone.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -2010,8 +2010,8 @@ final internal class PBFoo : GeneratedMessage { override class internal func decode(jsonMap:Dictionary) throws -> PBFoo { return try PBFoo.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class internal func fromJSON(data:Data) throws -> PBFoo { - return try PBFoo.Builder.fromJSONToBuilder(data:data).build() + override class internal func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBFoo { + return try PBFoo.Builder.fromJSONToBuilder(data:data, options:options).build() } override internal func getDescription(indent:String) throws -> String { var output = "" @@ -2144,8 +2144,8 @@ final internal class PBFoo : GeneratedMessage { } return resultDecodedBuilder } - override class internal func fromJSONToBuilder(data:Data) throws -> PBFoo.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class internal func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBFoo.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -2226,8 +2226,8 @@ final internal class PBBar : GeneratedMessage { override class internal func decode(jsonMap:Dictionary) throws -> PBBar { return try PBBar.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class internal func fromJSON(data:Data) throws -> PBBar { - return try PBBar.Builder.fromJSONToBuilder(data:data).build() + override class internal func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBBar { + return try PBBar.Builder.fromJSONToBuilder(data:data, options:options).build() } override internal func getDescription(indent:String) throws -> String { var output = "" @@ -2399,8 +2399,8 @@ final internal class PBBar : GeneratedMessage { } return resultDecodedBuilder } - override class internal func fromJSONToBuilder(data:Data) throws -> PBBar.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class internal func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBBar.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -2481,8 +2481,8 @@ final internal class PBBaz : GeneratedMessage { override class internal func decode(jsonMap:Dictionary) throws -> PBBaz { return try PBBaz.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class internal func fromJSON(data:Data) throws -> PBBaz { - return try PBBaz.Builder.fromJSONToBuilder(data:data).build() + override class internal func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBBaz { + return try PBBaz.Builder.fromJSONToBuilder(data:data, options:options).build() } override internal func getDescription(indent:String) throws -> String { var output = "" @@ -2654,8 +2654,8 @@ final internal class PBBaz : GeneratedMessage { } return resultDecodedBuilder } - override class internal func fromJSONToBuilder(data:Data) throws -> PBBaz.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class internal func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> PBBaz.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/Bar.Foo.proto.swift b/plugin/Tests/pbTests/Bar.Foo.proto.swift index ccce25f..7297160 100644 --- a/plugin/Tests/pbTests/Bar.Foo.proto.swift +++ b/plugin/Tests/pbTests/Bar.Foo.proto.swift @@ -92,8 +92,8 @@ public extension Bar { override class public func decode(jsonMap:Dictionary) throws -> Bar.Foo { return try Bar.Foo.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Bar.Foo { - return try Bar.Foo.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Bar.Foo { + return try Bar.Foo.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -223,8 +223,8 @@ public extension Bar { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Bar.Foo.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Bar.Foo.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/Baz.Foo.proto.swift b/plugin/Tests/pbTests/Baz.Foo.proto.swift index e96258e..dfc3b69 100644 --- a/plugin/Tests/pbTests/Baz.Foo.proto.swift +++ b/plugin/Tests/pbTests/Baz.Foo.proto.swift @@ -92,8 +92,8 @@ public extension Baz { override class public func decode(jsonMap:Dictionary) throws -> Baz.Foo { return try Baz.Foo.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Baz.Foo { - return try Baz.Foo.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Baz.Foo { + return try Baz.Foo.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -223,8 +223,8 @@ public extension Baz { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Baz.Foo.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Baz.Foo.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/Google.Protobuf.NoGenericServicesTest.UnittestNoGenericServices.proto.swift b/plugin/Tests/pbTests/Google.Protobuf.NoGenericServicesTest.UnittestNoGenericServices.proto.swift index 493848d..48dac1e 100644 --- a/plugin/Tests/pbTests/Google.Protobuf.NoGenericServicesTest.UnittestNoGenericServices.proto.swift +++ b/plugin/Tests/pbTests/Google.Protobuf.NoGenericServicesTest.UnittestNoGenericServices.proto.swift @@ -140,8 +140,8 @@ public extension Google.Protobuf.NoGenericServicesTest { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.NoGenericServicesTest.TestMessage { return try Google.Protobuf.NoGenericServicesTest.TestMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.NoGenericServicesTest.TestMessage { - return try Google.Protobuf.NoGenericServicesTest.TestMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.NoGenericServicesTest.TestMessage { + return try Google.Protobuf.NoGenericServicesTest.TestMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -276,8 +276,8 @@ public extension Google.Protobuf.NoGenericServicesTest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.NoGenericServicesTest.TestMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.NoGenericServicesTest.TestMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/Google.Protobuf.UnittestEnormousDescriptor.proto.swift b/plugin/Tests/pbTests/Google.Protobuf.UnittestEnormousDescriptor.proto.swift index 915b2b0..11eadc8 100644 --- a/plugin/Tests/pbTests/Google.Protobuf.UnittestEnormousDescriptor.proto.swift +++ b/plugin/Tests/pbTests/Google.Protobuf.UnittestEnormousDescriptor.proto.swift @@ -13079,8 +13079,8 @@ public extension Google.Protobuf { override class public func decode(jsonMap:Dictionary) throws -> Google.Protobuf.TestEnormousDescriptor { return try Google.Protobuf.TestEnormousDescriptor.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Google.Protobuf.TestEnormousDescriptor { - return try Google.Protobuf.TestEnormousDescriptor.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.TestEnormousDescriptor { + return try Google.Protobuf.TestEnormousDescriptor.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -53170,8 +53170,8 @@ public extension Google.Protobuf { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Google.Protobuf.TestEnormousDescriptor.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Google.Protobuf.TestEnormousDescriptor.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/Proto2ArenaUnittest.UnittestArena.proto.swift b/plugin/Tests/pbTests/Proto2ArenaUnittest.UnittestArena.proto.swift index 9364c75..bce8229 100644 --- a/plugin/Tests/pbTests/Proto2ArenaUnittest.UnittestArena.proto.swift +++ b/plugin/Tests/pbTests/Proto2ArenaUnittest.UnittestArena.proto.swift @@ -93,8 +93,8 @@ public extension Proto2ArenaUnittest { override class public func decode(jsonMap:Dictionary) throws -> Proto2ArenaUnittest.NestedMessage { return try Proto2ArenaUnittest.NestedMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Proto2ArenaUnittest.NestedMessage { - return try Proto2ArenaUnittest.NestedMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2ArenaUnittest.NestedMessage { + return try Proto2ArenaUnittest.NestedMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -226,8 +226,8 @@ public extension Proto2ArenaUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Proto2ArenaUnittest.NestedMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2ArenaUnittest.NestedMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -326,8 +326,8 @@ public extension Proto2ArenaUnittest { override class public func decode(jsonMap:Dictionary) throws -> Proto2ArenaUnittest.ArenaMessage { return try Proto2ArenaUnittest.ArenaMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Proto2ArenaUnittest.ArenaMessage { - return try Proto2ArenaUnittest.ArenaMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2ArenaUnittest.ArenaMessage { + return try Proto2ArenaUnittest.ArenaMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -507,8 +507,8 @@ public extension Proto2ArenaUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Proto2ArenaUnittest.ArenaMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2ArenaUnittest.ArenaMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/Proto2ArenaUnittest.UnittestNoArenaImport.proto.swift b/plugin/Tests/pbTests/Proto2ArenaUnittest.UnittestNoArenaImport.proto.swift index defca1d..b3c3004 100644 --- a/plugin/Tests/pbTests/Proto2ArenaUnittest.UnittestNoArenaImport.proto.swift +++ b/plugin/Tests/pbTests/Proto2ArenaUnittest.UnittestNoArenaImport.proto.swift @@ -92,8 +92,8 @@ public extension Proto2ArenaUnittest { override class public func decode(jsonMap:Dictionary) throws -> Proto2ArenaUnittest.ImportNoArenaNestedMessage { return try Proto2ArenaUnittest.ImportNoArenaNestedMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Proto2ArenaUnittest.ImportNoArenaNestedMessage { - return try Proto2ArenaUnittest.ImportNoArenaNestedMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2ArenaUnittest.ImportNoArenaNestedMessage { + return try Proto2ArenaUnittest.ImportNoArenaNestedMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -225,8 +225,8 @@ public extension Proto2ArenaUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Proto2ArenaUnittest.ImportNoArenaNestedMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2ArenaUnittest.ImportNoArenaNestedMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/Proto2NofieldpresenceUnittest.UnittestNoFieldPresence.proto.swift b/plugin/Tests/pbTests/Proto2NofieldpresenceUnittest.UnittestNoFieldPresence.proto.swift index 75b4c88..39d2c4b 100644 --- a/plugin/Tests/pbTests/Proto2NofieldpresenceUnittest.UnittestNoFieldPresence.proto.swift +++ b/plugin/Tests/pbTests/Proto2NofieldpresenceUnittest.UnittestNoFieldPresence.proto.swift @@ -203,8 +203,8 @@ public extension Proto2NofieldpresenceUnittest { override class public func decode(jsonMap:Dictionary) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage { return try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage { - return try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage { + return try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -336,8 +336,8 @@ public extension Proto2NofieldpresenceUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1405,8 +1405,8 @@ public extension Proto2NofieldpresenceUnittest { override class public func decode(jsonMap:Dictionary) throws -> Proto2NofieldpresenceUnittest.TestAllTypes { return try Proto2NofieldpresenceUnittest.TestAllTypes.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Proto2NofieldpresenceUnittest.TestAllTypes { - return try Proto2NofieldpresenceUnittest.TestAllTypes.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2NofieldpresenceUnittest.TestAllTypes { + return try Proto2NofieldpresenceUnittest.TestAllTypes.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -3841,8 +3841,8 @@ public extension Proto2NofieldpresenceUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -3926,8 +3926,8 @@ public extension Proto2NofieldpresenceUnittest { override class public func decode(jsonMap:Dictionary) throws -> Proto2NofieldpresenceUnittest.TestProto2Required { return try Proto2NofieldpresenceUnittest.TestProto2Required.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Proto2NofieldpresenceUnittest.TestProto2Required { - return try Proto2NofieldpresenceUnittest.TestProto2Required.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2NofieldpresenceUnittest.TestProto2Required { + return try Proto2NofieldpresenceUnittest.TestProto2Required.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -4098,8 +4098,8 @@ public extension Proto2NofieldpresenceUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Proto2NofieldpresenceUnittest.TestProto2Required.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2NofieldpresenceUnittest.TestProto2Required.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -4181,8 +4181,8 @@ public extension Proto2NofieldpresenceUnittest { override class public func decode(jsonMap:Dictionary) throws -> Proto2NofieldpresenceUnittest.ForeignMessage { return try Proto2NofieldpresenceUnittest.ForeignMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Proto2NofieldpresenceUnittest.ForeignMessage { - return try Proto2NofieldpresenceUnittest.ForeignMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2NofieldpresenceUnittest.ForeignMessage { + return try Proto2NofieldpresenceUnittest.ForeignMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -4314,8 +4314,8 @@ public extension Proto2NofieldpresenceUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Proto2NofieldpresenceUnittest.ForeignMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2NofieldpresenceUnittest.ForeignMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/Proto3ArenaUnittest.UnittestProto3Arena.proto.swift b/plugin/Tests/pbTests/Proto3ArenaUnittest.UnittestProto3Arena.proto.swift index 5e6ffbd..e7db77d 100644 --- a/plugin/Tests/pbTests/Proto3ArenaUnittest.UnittestProto3Arena.proto.swift +++ b/plugin/Tests/pbTests/Proto3ArenaUnittest.UnittestProto3Arena.proto.swift @@ -211,8 +211,8 @@ public extension Proto3ArenaUnittest { override class public func decode(jsonMap:Dictionary) throws -> Proto3ArenaUnittest.TestAllTypes.NestedMessage { return try Proto3ArenaUnittest.TestAllTypes.NestedMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Proto3ArenaUnittest.TestAllTypes.NestedMessage { - return try Proto3ArenaUnittest.TestAllTypes.NestedMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3ArenaUnittest.TestAllTypes.NestedMessage { + return try Proto3ArenaUnittest.TestAllTypes.NestedMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -347,8 +347,8 @@ public extension Proto3ArenaUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Proto3ArenaUnittest.TestAllTypes.NestedMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3ArenaUnittest.TestAllTypes.NestedMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1437,8 +1437,8 @@ public extension Proto3ArenaUnittest { override class public func decode(jsonMap:Dictionary) throws -> Proto3ArenaUnittest.TestAllTypes { return try Proto3ArenaUnittest.TestAllTypes.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Proto3ArenaUnittest.TestAllTypes { - return try Proto3ArenaUnittest.TestAllTypes.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3ArenaUnittest.TestAllTypes { + return try Proto3ArenaUnittest.TestAllTypes.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -3945,8 +3945,8 @@ public extension Proto3ArenaUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Proto3ArenaUnittest.TestAllTypes.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3ArenaUnittest.TestAllTypes.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -4377,8 +4377,8 @@ public extension Proto3ArenaUnittest { override class public func decode(jsonMap:Dictionary) throws -> Proto3ArenaUnittest.TestPackedTypes { return try Proto3ArenaUnittest.TestPackedTypes.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Proto3ArenaUnittest.TestPackedTypes { - return try Proto3ArenaUnittest.TestPackedTypes.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3ArenaUnittest.TestPackedTypes { + return try Proto3ArenaUnittest.TestPackedTypes.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -5090,8 +5090,8 @@ public extension Proto3ArenaUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Proto3ArenaUnittest.TestPackedTypes.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3ArenaUnittest.TestPackedTypes.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -5523,8 +5523,8 @@ public extension Proto3ArenaUnittest { override class public func decode(jsonMap:Dictionary) throws -> Proto3ArenaUnittest.TestUnpackedTypes { return try Proto3ArenaUnittest.TestUnpackedTypes.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Proto3ArenaUnittest.TestUnpackedTypes { - return try Proto3ArenaUnittest.TestUnpackedTypes.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3ArenaUnittest.TestUnpackedTypes { + return try Proto3ArenaUnittest.TestUnpackedTypes.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -6236,8 +6236,8 @@ public extension Proto3ArenaUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Proto3ArenaUnittest.TestUnpackedTypes.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3ArenaUnittest.TestUnpackedTypes.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -6333,8 +6333,8 @@ public extension Proto3ArenaUnittest { override class public func decode(jsonMap:Dictionary) throws -> Proto3ArenaUnittest.NestedTestAllTypes { return try Proto3ArenaUnittest.NestedTestAllTypes.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Proto3ArenaUnittest.NestedTestAllTypes { - return try Proto3ArenaUnittest.NestedTestAllTypes.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3ArenaUnittest.NestedTestAllTypes { + return try Proto3ArenaUnittest.NestedTestAllTypes.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -6586,8 +6586,8 @@ public extension Proto3ArenaUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Proto3ArenaUnittest.NestedTestAllTypes.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3ArenaUnittest.NestedTestAllTypes.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -6669,8 +6669,8 @@ public extension Proto3ArenaUnittest { override class public func decode(jsonMap:Dictionary) throws -> Proto3ArenaUnittest.ForeignMessage { return try Proto3ArenaUnittest.ForeignMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Proto3ArenaUnittest.ForeignMessage { - return try Proto3ArenaUnittest.ForeignMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3ArenaUnittest.ForeignMessage { + return try Proto3ArenaUnittest.ForeignMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -6802,8 +6802,8 @@ public extension Proto3ArenaUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Proto3ArenaUnittest.ForeignMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3ArenaUnittest.ForeignMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -6871,8 +6871,8 @@ public extension Proto3ArenaUnittest { override class public func decode(jsonMap:Dictionary) throws -> Proto3ArenaUnittest.TestEmptyMessage { return try Proto3ArenaUnittest.TestEmptyMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Proto3ArenaUnittest.TestEmptyMessage { - return try Proto3ArenaUnittest.TestEmptyMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3ArenaUnittest.TestEmptyMessage { + return try Proto3ArenaUnittest.TestEmptyMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -6962,8 +6962,8 @@ public extension Proto3ArenaUnittest { let resultDecodedBuilder = Proto3ArenaUnittest.TestEmptyMessage.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Proto3ArenaUnittest.TestEmptyMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3ArenaUnittest.TestEmptyMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/Proto3PreserveUnknownEnumUnittest.UnittestPreserveUnknownEnum.proto.swift b/plugin/Tests/pbTests/Proto3PreserveUnknownEnumUnittest.UnittestPreserveUnknownEnum.proto.swift index 16e264d..a501056 100644 --- a/plugin/Tests/pbTests/Proto3PreserveUnknownEnumUnittest.UnittestPreserveUnknownEnum.proto.swift +++ b/plugin/Tests/pbTests/Proto3PreserveUnknownEnumUnittest.UnittestPreserveUnknownEnum.proto.swift @@ -359,8 +359,8 @@ public extension Proto3PreserveUnknownEnumUnittest { override class public func decode(jsonMap:Dictionary) throws -> Proto3PreserveUnknownEnumUnittest.MyMessage { return try Proto3PreserveUnknownEnumUnittest.MyMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Proto3PreserveUnknownEnumUnittest.MyMessage { - return try Proto3PreserveUnknownEnumUnittest.MyMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3PreserveUnknownEnumUnittest.MyMessage { + return try Proto3PreserveUnknownEnumUnittest.MyMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -740,8 +740,8 @@ public extension Proto3PreserveUnknownEnumUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Proto3PreserveUnknownEnumUnittest.MyMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3PreserveUnknownEnumUnittest.MyMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1000,8 +1000,8 @@ public extension Proto3PreserveUnknownEnumUnittest { override class public func decode(jsonMap:Dictionary) throws -> Proto3PreserveUnknownEnumUnittest.MyMessagePlusExtra { return try Proto3PreserveUnknownEnumUnittest.MyMessagePlusExtra.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> Proto3PreserveUnknownEnumUnittest.MyMessagePlusExtra { - return try Proto3PreserveUnknownEnumUnittest.MyMessagePlusExtra.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3PreserveUnknownEnumUnittest.MyMessagePlusExtra { + return try Proto3PreserveUnknownEnumUnittest.MyMessagePlusExtra.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1380,8 +1380,8 @@ public extension Proto3PreserveUnknownEnumUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> Proto3PreserveUnknownEnumUnittest.MyMessagePlusExtra.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto3PreserveUnknownEnumUnittest.MyMessagePlusExtra.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/ProtobufUnittest.Unittest.proto.swift b/plugin/Tests/pbTests/ProtobufUnittest.Unittest.proto.swift index a4ad30d..8eb0152 100644 --- a/plugin/Tests/pbTests/ProtobufUnittest.Unittest.proto.swift +++ b/plugin/Tests/pbTests/ProtobufUnittest.Unittest.proto.swift @@ -1544,8 +1544,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestAllTypes.NestedMessage { return try ProtobufUnittest.TestAllTypes.NestedMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestAllTypes.NestedMessage { - return try ProtobufUnittest.TestAllTypes.NestedMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllTypes.NestedMessage { + return try ProtobufUnittest.TestAllTypes.NestedMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1680,8 +1680,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestAllTypes.NestedMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllTypes.NestedMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1767,8 +1767,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestAllTypes.OptionalGroup { return try ProtobufUnittest.TestAllTypes.OptionalGroup.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestAllTypes.OptionalGroup { - return try ProtobufUnittest.TestAllTypes.OptionalGroup.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllTypes.OptionalGroup { + return try ProtobufUnittest.TestAllTypes.OptionalGroup.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1900,8 +1900,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestAllTypes.OptionalGroup.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllTypes.OptionalGroup.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1987,8 +1987,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestAllTypes.RepeatedGroup { return try ProtobufUnittest.TestAllTypes.RepeatedGroup.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestAllTypes.RepeatedGroup { - return try ProtobufUnittest.TestAllTypes.RepeatedGroup.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllTypes.RepeatedGroup { + return try ProtobufUnittest.TestAllTypes.RepeatedGroup.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -2120,8 +2120,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestAllTypes.RepeatedGroup.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllTypes.RepeatedGroup.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -3395,8 +3395,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestAllTypes { return try ProtobufUnittest.TestAllTypes.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestAllTypes { - return try ProtobufUnittest.TestAllTypes.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllTypes { + return try ProtobufUnittest.TestAllTypes.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -6884,8 +6884,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestAllTypes.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllTypes.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -6997,8 +6997,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.NestedTestAllTypes { return try ProtobufUnittest.NestedTestAllTypes.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.NestedTestAllTypes { - return try ProtobufUnittest.NestedTestAllTypes.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.NestedTestAllTypes { + return try ProtobufUnittest.NestedTestAllTypes.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -7295,8 +7295,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.NestedTestAllTypes.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.NestedTestAllTypes.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -7377,8 +7377,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestDeprecatedFields { return try ProtobufUnittest.TestDeprecatedFields.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestDeprecatedFields { - return try ProtobufUnittest.TestDeprecatedFields.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestDeprecatedFields { + return try ProtobufUnittest.TestDeprecatedFields.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -7510,8 +7510,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestDeprecatedFields.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestDeprecatedFields.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -7593,8 +7593,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.ForeignMessage { return try ProtobufUnittest.ForeignMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.ForeignMessage { - return try ProtobufUnittest.ForeignMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.ForeignMessage { + return try ProtobufUnittest.ForeignMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -7726,8 +7726,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.ForeignMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.ForeignMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -7794,8 +7794,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestReservedFields { return try ProtobufUnittest.TestReservedFields.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestReservedFields { - return try ProtobufUnittest.TestReservedFields.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestReservedFields { + return try ProtobufUnittest.TestReservedFields.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -7885,8 +7885,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.TestReservedFields.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestReservedFields.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestReservedFields.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -7956,8 +7956,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestAllExtensions { return try ProtobufUnittest.TestAllExtensions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestAllExtensions { - return try ProtobufUnittest.TestAllExtensions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllExtensions { + return try ProtobufUnittest.TestAllExtensions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -8050,8 +8050,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.TestAllExtensions.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestAllExtensions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllExtensions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -8131,8 +8131,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.OptionalGroupExtension { return try ProtobufUnittest.OptionalGroupExtension.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.OptionalGroupExtension { - return try ProtobufUnittest.OptionalGroupExtension.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.OptionalGroupExtension { + return try ProtobufUnittest.OptionalGroupExtension.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -8264,8 +8264,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.OptionalGroupExtension.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.OptionalGroupExtension.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -8345,8 +8345,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.RepeatedGroupExtension { return try ProtobufUnittest.RepeatedGroupExtension.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.RepeatedGroupExtension { - return try ProtobufUnittest.RepeatedGroupExtension.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.RepeatedGroupExtension { + return try ProtobufUnittest.RepeatedGroupExtension.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -8478,8 +8478,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.RepeatedGroupExtension.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.RepeatedGroupExtension.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -8552,8 +8552,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestNestedExtension { return try ProtobufUnittest.TestNestedExtension.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestNestedExtension { - return try ProtobufUnittest.TestNestedExtension.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestNestedExtension { + return try ProtobufUnittest.TestNestedExtension.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -8643,8 +8643,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.TestNestedExtension.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestNestedExtension.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestNestedExtension.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -9162,8 +9162,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestRequired { return try ProtobufUnittest.TestRequired.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestRequired { - return try ProtobufUnittest.TestRequired.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestRequired { + return try ProtobufUnittest.TestRequired.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -10641,8 +10641,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestRequired.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestRequired.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -10758,8 +10758,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestRequiredForeign { return try ProtobufUnittest.TestRequiredForeign.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestRequiredForeign { - return try ProtobufUnittest.TestRequiredForeign.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestRequiredForeign { + return try ProtobufUnittest.TestRequiredForeign.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -11017,8 +11017,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestRequiredForeign.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestRequiredForeign.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -11100,8 +11100,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestForeignNested { return try ProtobufUnittest.TestForeignNested.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestForeignNested { - return try ProtobufUnittest.TestForeignNested.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestForeignNested { + return try ProtobufUnittest.TestForeignNested.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -11272,8 +11272,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestForeignNested.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestForeignNested.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -11341,8 +11341,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestEmptyMessage { return try ProtobufUnittest.TestEmptyMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestEmptyMessage { - return try ProtobufUnittest.TestEmptyMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestEmptyMessage { + return try ProtobufUnittest.TestEmptyMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -11432,8 +11432,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.TestEmptyMessage.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestEmptyMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestEmptyMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -11505,8 +11505,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestEmptyMessageWithExtensions { return try ProtobufUnittest.TestEmptyMessageWithExtensions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestEmptyMessageWithExtensions { - return try ProtobufUnittest.TestEmptyMessageWithExtensions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestEmptyMessageWithExtensions { + return try ProtobufUnittest.TestEmptyMessageWithExtensions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -11599,8 +11599,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.TestEmptyMessageWithExtensions.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestEmptyMessageWithExtensions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestEmptyMessageWithExtensions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -11674,8 +11674,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestMultipleExtensionRanges { return try ProtobufUnittest.TestMultipleExtensionRanges.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestMultipleExtensionRanges { - return try ProtobufUnittest.TestMultipleExtensionRanges.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMultipleExtensionRanges { + return try ProtobufUnittest.TestMultipleExtensionRanges.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -11772,8 +11772,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.TestMultipleExtensionRanges.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestMultipleExtensionRanges.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMultipleExtensionRanges.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -11869,8 +11869,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestReallyLargeTagNumber { return try ProtobufUnittest.TestReallyLargeTagNumber.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestReallyLargeTagNumber { - return try ProtobufUnittest.TestReallyLargeTagNumber.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestReallyLargeTagNumber { + return try ProtobufUnittest.TestReallyLargeTagNumber.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -12046,8 +12046,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestReallyLargeTagNumber.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestReallyLargeTagNumber.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -12141,8 +12141,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestRecursiveMessage { return try ProtobufUnittest.TestRecursiveMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestRecursiveMessage { - return try ProtobufUnittest.TestRecursiveMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestRecursiveMessage { + return try ProtobufUnittest.TestRecursiveMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -12355,8 +12355,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestRecursiveMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestRecursiveMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -12438,8 +12438,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestMutualRecursionA { return try ProtobufUnittest.TestMutualRecursionA.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestMutualRecursionA { - return try ProtobufUnittest.TestMutualRecursionA.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMutualRecursionA { + return try ProtobufUnittest.TestMutualRecursionA.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -12610,8 +12610,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestMutualRecursionA.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMutualRecursionA.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -12705,8 +12705,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestMutualRecursionB { return try ProtobufUnittest.TestMutualRecursionB.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestMutualRecursionB { - return try ProtobufUnittest.TestMutualRecursionB.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMutualRecursionB { + return try ProtobufUnittest.TestMutualRecursionB.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -12919,8 +12919,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestMutualRecursionB.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMutualRecursionB.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -13023,8 +13023,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestDupFieldNumber.Foo { return try ProtobufUnittest.TestDupFieldNumber.Foo.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestDupFieldNumber.Foo { - return try ProtobufUnittest.TestDupFieldNumber.Foo.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestDupFieldNumber.Foo { + return try ProtobufUnittest.TestDupFieldNumber.Foo.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -13156,8 +13156,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestDupFieldNumber.Foo.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestDupFieldNumber.Foo.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -13243,8 +13243,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestDupFieldNumber.Bar { return try ProtobufUnittest.TestDupFieldNumber.Bar.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestDupFieldNumber.Bar { - return try ProtobufUnittest.TestDupFieldNumber.Bar.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestDupFieldNumber.Bar { + return try ProtobufUnittest.TestDupFieldNumber.Bar.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -13376,8 +13376,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestDupFieldNumber.Bar.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestDupFieldNumber.Bar.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -13473,8 +13473,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestDupFieldNumber { return try ProtobufUnittest.TestDupFieldNumber.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestDupFieldNumber { - return try ProtobufUnittest.TestDupFieldNumber.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestDupFieldNumber { + return try ProtobufUnittest.TestDupFieldNumber.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -13769,8 +13769,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestDupFieldNumber.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestDupFieldNumber.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -13852,8 +13852,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestEagerMessage { return try ProtobufUnittest.TestEagerMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestEagerMessage { - return try ProtobufUnittest.TestEagerMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestEagerMessage { + return try ProtobufUnittest.TestEagerMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -14024,8 +14024,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestEagerMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestEagerMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -14106,8 +14106,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestLazyMessage { return try ProtobufUnittest.TestLazyMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestLazyMessage { - return try ProtobufUnittest.TestLazyMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestLazyMessage { + return try ProtobufUnittest.TestLazyMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -14278,8 +14278,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestLazyMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestLazyMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -14400,8 +14400,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestNestedMessageHasBits.NestedMessage { return try ProtobufUnittest.TestNestedMessageHasBits.NestedMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestNestedMessageHasBits.NestedMessage { - return try ProtobufUnittest.TestNestedMessageHasBits.NestedMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestNestedMessageHasBits.NestedMessage { + return try ProtobufUnittest.TestNestedMessageHasBits.NestedMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -14575,8 +14575,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestNestedMessageHasBits.NestedMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestNestedMessageHasBits.NestedMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -14646,8 +14646,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestNestedMessageHasBits { return try ProtobufUnittest.TestNestedMessageHasBits.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestNestedMessageHasBits { - return try ProtobufUnittest.TestNestedMessageHasBits.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestNestedMessageHasBits { + return try ProtobufUnittest.TestNestedMessageHasBits.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -14818,8 +14818,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestNestedMessageHasBits.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestNestedMessageHasBits.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -15081,8 +15081,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestCamelCaseFieldNames { return try ProtobufUnittest.TestCamelCaseFieldNames.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestCamelCaseFieldNames { - return try ProtobufUnittest.TestCamelCaseFieldNames.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestCamelCaseFieldNames { + return try ProtobufUnittest.TestCamelCaseFieldNames.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -15706,8 +15706,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestCamelCaseFieldNames.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestCamelCaseFieldNames.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -15827,8 +15827,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestFieldOrderings.NestedMessage { return try ProtobufUnittest.TestFieldOrderings.NestedMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestFieldOrderings.NestedMessage { - return try ProtobufUnittest.TestFieldOrderings.NestedMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestFieldOrderings.NestedMessage { + return try ProtobufUnittest.TestFieldOrderings.NestedMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -16005,8 +16005,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestFieldOrderings.NestedMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestFieldOrderings.NestedMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -16115,8 +16115,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestFieldOrderings { return try ProtobufUnittest.TestFieldOrderings.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestFieldOrderings { - return try ProtobufUnittest.TestFieldOrderings.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestFieldOrderings { + return try ProtobufUnittest.TestFieldOrderings.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -16416,8 +16416,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestFieldOrderings.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestFieldOrderings.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -16847,8 +16847,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestExtremeDefaultValues { return try ProtobufUnittest.TestExtremeDefaultValues.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestExtremeDefaultValues { - return try ProtobufUnittest.TestExtremeDefaultValues.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestExtremeDefaultValues { + return try ProtobufUnittest.TestExtremeDefaultValues.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -18068,8 +18068,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestExtremeDefaultValues.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestExtremeDefaultValues.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -18148,8 +18148,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.SparseEnumMessage { return try ProtobufUnittest.SparseEnumMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.SparseEnumMessage { - return try ProtobufUnittest.SparseEnumMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.SparseEnumMessage { + return try ProtobufUnittest.SparseEnumMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -18284,8 +18284,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.SparseEnumMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.SparseEnumMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -18366,8 +18366,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.OneString { return try ProtobufUnittest.OneString.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.OneString { - return try ProtobufUnittest.OneString.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.OneString { + return try ProtobufUnittest.OneString.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -18497,8 +18497,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.OneString.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.OneString.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -18585,8 +18585,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.MoreString { return try ProtobufUnittest.MoreString.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.MoreString { - return try ProtobufUnittest.MoreString.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.MoreString { + return try ProtobufUnittest.MoreString.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -18715,8 +18715,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.MoreString.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.MoreString.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -18796,8 +18796,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.OneBytes { return try ProtobufUnittest.OneBytes.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.OneBytes { - return try ProtobufUnittest.OneBytes.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.OneBytes { + return try ProtobufUnittest.OneBytes.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -18927,8 +18927,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.OneBytes.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.OneBytes.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -19015,8 +19015,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.MoreBytes { return try ProtobufUnittest.MoreBytes.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.MoreBytes { - return try ProtobufUnittest.MoreBytes.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.MoreBytes { + return try ProtobufUnittest.MoreBytes.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -19145,8 +19145,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.MoreBytes.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.MoreBytes.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -19227,8 +19227,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.Int32Message { return try ProtobufUnittest.Int32Message.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.Int32Message { - return try ProtobufUnittest.Int32Message.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.Int32Message { + return try ProtobufUnittest.Int32Message.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -19360,8 +19360,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.Int32Message.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.Int32Message.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -19441,8 +19441,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.Uint32Message { return try ProtobufUnittest.Uint32Message.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.Uint32Message { - return try ProtobufUnittest.Uint32Message.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.Uint32Message { + return try ProtobufUnittest.Uint32Message.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -19574,8 +19574,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.Uint32Message.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.Uint32Message.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -19655,8 +19655,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.Int64Message { return try ProtobufUnittest.Int64Message.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.Int64Message { - return try ProtobufUnittest.Int64Message.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.Int64Message { + return try ProtobufUnittest.Int64Message.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -19788,8 +19788,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.Int64Message.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.Int64Message.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -19869,8 +19869,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.Uint64Message { return try ProtobufUnittest.Uint64Message.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.Uint64Message { - return try ProtobufUnittest.Uint64Message.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.Uint64Message { + return try ProtobufUnittest.Uint64Message.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -20002,8 +20002,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.Uint64Message.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.Uint64Message.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -20083,8 +20083,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.BoolMessage { return try ProtobufUnittest.BoolMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.BoolMessage { - return try ProtobufUnittest.BoolMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.BoolMessage { + return try ProtobufUnittest.BoolMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -20214,8 +20214,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.BoolMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.BoolMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -20329,8 +20329,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestOneof.FooGroup { return try ProtobufUnittest.TestOneof.FooGroup.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestOneof.FooGroup { - return try ProtobufUnittest.TestOneof.FooGroup.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOneof.FooGroup { + return try ProtobufUnittest.TestOneof.FooGroup.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -20502,8 +20502,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestOneof.FooGroup.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOneof.FooGroup.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -20737,8 +20737,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestOneof { return try ProtobufUnittest.TestOneof.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestOneof { - return try ProtobufUnittest.TestOneof.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOneof { + return try ProtobufUnittest.TestOneof.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -21076,8 +21076,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestOneof.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOneof.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -21190,8 +21190,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestOneofBackwardsCompatible.FooGroup { return try ProtobufUnittest.TestOneofBackwardsCompatible.FooGroup.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestOneofBackwardsCompatible.FooGroup { - return try ProtobufUnittest.TestOneofBackwardsCompatible.FooGroup.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOneofBackwardsCompatible.FooGroup { + return try ProtobufUnittest.TestOneofBackwardsCompatible.FooGroup.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -21363,8 +21363,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestOneofBackwardsCompatible.FooGroup.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOneofBackwardsCompatible.FooGroup.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -21471,8 +21471,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestOneofBackwardsCompatible { return try ProtobufUnittest.TestOneofBackwardsCompatible.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestOneofBackwardsCompatible { - return try ProtobufUnittest.TestOneofBackwardsCompatible.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOneofBackwardsCompatible { + return try ProtobufUnittest.TestOneofBackwardsCompatible.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -21806,8 +21806,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestOneofBackwardsCompatible.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOneofBackwardsCompatible.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -21933,8 +21933,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestOneof2.FooGroup { return try ProtobufUnittest.TestOneof2.FooGroup.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestOneof2.FooGroup { - return try ProtobufUnittest.TestOneof2.FooGroup.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOneof2.FooGroup { + return try ProtobufUnittest.TestOneof2.FooGroup.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -22106,8 +22106,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestOneof2.FooGroup.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOneof2.FooGroup.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -22213,8 +22213,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestOneof2.NestedMessage { return try ProtobufUnittest.TestOneof2.NestedMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestOneof2.NestedMessage { - return try ProtobufUnittest.TestOneof2.NestedMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOneof2.NestedMessage { + return try ProtobufUnittest.TestOneof2.NestedMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -22385,8 +22385,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestOneof2.NestedMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOneof2.NestedMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -23127,8 +23127,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestOneof2 { return try ProtobufUnittest.TestOneof2.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestOneof2 { - return try ProtobufUnittest.TestOneof2.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOneof2 { + return try ProtobufUnittest.TestOneof2.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -24045,8 +24045,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestOneof2.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOneof2.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -24148,8 +24148,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestRequiredOneof.NestedMessage { return try ProtobufUnittest.TestRequiredOneof.NestedMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestRequiredOneof.NestedMessage { - return try ProtobufUnittest.TestRequiredOneof.NestedMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestRequiredOneof.NestedMessage { + return try ProtobufUnittest.TestRequiredOneof.NestedMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -24281,8 +24281,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestRequiredOneof.NestedMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestRequiredOneof.NestedMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -24479,8 +24479,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestRequiredOneof { return try ProtobufUnittest.TestRequiredOneof.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestRequiredOneof { - return try ProtobufUnittest.TestRequiredOneof.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestRequiredOneof { + return try ProtobufUnittest.TestRequiredOneof.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -24737,8 +24737,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestRequiredOneof.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestRequiredOneof.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -25169,8 +25169,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestPackedTypes { return try ProtobufUnittest.TestPackedTypes.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestPackedTypes { - return try ProtobufUnittest.TestPackedTypes.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestPackedTypes { + return try ProtobufUnittest.TestPackedTypes.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -25882,8 +25882,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestPackedTypes.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestPackedTypes.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -26217,8 +26217,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestUnpackedTypes { return try ProtobufUnittest.TestUnpackedTypes.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestUnpackedTypes { - return try ProtobufUnittest.TestUnpackedTypes.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestUnpackedTypes { + return try ProtobufUnittest.TestUnpackedTypes.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -26860,8 +26860,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestUnpackedTypes.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestUnpackedTypes.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -26931,8 +26931,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestPackedExtensions { return try ProtobufUnittest.TestPackedExtensions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestPackedExtensions { - return try ProtobufUnittest.TestPackedExtensions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestPackedExtensions { + return try ProtobufUnittest.TestPackedExtensions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -27025,8 +27025,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.TestPackedExtensions.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestPackedExtensions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestPackedExtensions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -27096,8 +27096,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestUnpackedExtensions { return try ProtobufUnittest.TestUnpackedExtensions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestUnpackedExtensions { - return try ProtobufUnittest.TestUnpackedExtensions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestUnpackedExtensions { + return try ProtobufUnittest.TestUnpackedExtensions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -27190,8 +27190,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.TestUnpackedExtensions.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestUnpackedExtensions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestUnpackedExtensions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -27297,8 +27297,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestDynamicExtensions.DynamicMessageType { return try ProtobufUnittest.TestDynamicExtensions.DynamicMessageType.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestDynamicExtensions.DynamicMessageType { - return try ProtobufUnittest.TestDynamicExtensions.DynamicMessageType.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestDynamicExtensions.DynamicMessageType { + return try ProtobufUnittest.TestDynamicExtensions.DynamicMessageType.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -27430,8 +27430,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestDynamicExtensions.DynamicMessageType.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestDynamicExtensions.DynamicMessageType.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -27635,8 +27635,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestDynamicExtensions { return try ProtobufUnittest.TestDynamicExtensions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestDynamicExtensions { - return try ProtobufUnittest.TestDynamicExtensions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestDynamicExtensions { + return try ProtobufUnittest.TestDynamicExtensions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -28103,8 +28103,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestDynamicExtensions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestDynamicExtensions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -28291,8 +28291,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestRepeatedScalarDifferentTagSizes { return try ProtobufUnittest.TestRepeatedScalarDifferentTagSizes.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestRepeatedScalarDifferentTagSizes { - return try ProtobufUnittest.TestRepeatedScalarDifferentTagSizes.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestRepeatedScalarDifferentTagSizes { + return try ProtobufUnittest.TestRepeatedScalarDifferentTagSizes.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -28622,8 +28622,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestRepeatedScalarDifferentTagSizes.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestRepeatedScalarDifferentTagSizes.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -28756,8 +28756,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Group1 { return try ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Group1.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Group1 { - return try ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Group1.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Group1 { + return try ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Group1.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -28928,8 +28928,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Group1.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Group1.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -29016,8 +29016,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Group2 { return try ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Group2.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Group2 { - return try ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Group2.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Group2 { + return try ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Group2.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -29188,8 +29188,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Group2.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Group2.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -29351,8 +29351,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator { return try ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator { - return try ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator { + return try ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -29757,8 +29757,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMerge.RepeatedFieldsGenerator.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -29845,8 +29845,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestParsingMerge.OptionalGroup { return try ProtobufUnittest.TestParsingMerge.OptionalGroup.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestParsingMerge.OptionalGroup { - return try ProtobufUnittest.TestParsingMerge.OptionalGroup.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMerge.OptionalGroup { + return try ProtobufUnittest.TestParsingMerge.OptionalGroup.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -30017,8 +30017,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestParsingMerge.OptionalGroup.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMerge.OptionalGroup.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -30105,8 +30105,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestParsingMerge.RepeatedGroup { return try ProtobufUnittest.TestParsingMerge.RepeatedGroup.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestParsingMerge.RepeatedGroup { - return try ProtobufUnittest.TestParsingMerge.RepeatedGroup.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMerge.RepeatedGroup { + return try ProtobufUnittest.TestParsingMerge.RepeatedGroup.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -30277,8 +30277,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestParsingMerge.RepeatedGroup.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMerge.RepeatedGroup.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -30415,8 +30415,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestParsingMerge { return try ProtobufUnittest.TestParsingMerge.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestParsingMerge { - return try ProtobufUnittest.TestParsingMerge.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMerge { + return try ProtobufUnittest.TestParsingMerge.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -30842,8 +30842,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestParsingMerge.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMerge.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -30924,8 +30924,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestCommentInjectionMessage { return try ProtobufUnittest.TestCommentInjectionMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestCommentInjectionMessage { - return try ProtobufUnittest.TestCommentInjectionMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestCommentInjectionMessage { + return try ProtobufUnittest.TestCommentInjectionMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -31056,8 +31056,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestCommentInjectionMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestCommentInjectionMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -31125,8 +31125,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.FooRequest { return try ProtobufUnittest.FooRequest.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.FooRequest { - return try ProtobufUnittest.FooRequest.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.FooRequest { + return try ProtobufUnittest.FooRequest.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -31216,8 +31216,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.FooRequest.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.FooRequest.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.FooRequest.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -31284,8 +31284,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.FooResponse { return try ProtobufUnittest.FooResponse.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.FooResponse { - return try ProtobufUnittest.FooResponse.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.FooResponse { + return try ProtobufUnittest.FooResponse.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -31375,8 +31375,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.FooResponse.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.FooResponse.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.FooResponse.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -31443,8 +31443,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.FooClientMessage { return try ProtobufUnittest.FooClientMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.FooClientMessage { - return try ProtobufUnittest.FooClientMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.FooClientMessage { + return try ProtobufUnittest.FooClientMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -31534,8 +31534,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.FooClientMessage.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.FooClientMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.FooClientMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -31602,8 +31602,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.FooServerMessage { return try ProtobufUnittest.FooServerMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.FooServerMessage { - return try ProtobufUnittest.FooServerMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.FooServerMessage { + return try ProtobufUnittest.FooServerMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -31693,8 +31693,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.FooServerMessage.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.FooServerMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.FooServerMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -31761,8 +31761,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.BarRequest { return try ProtobufUnittest.BarRequest.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.BarRequest { - return try ProtobufUnittest.BarRequest.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.BarRequest { + return try ProtobufUnittest.BarRequest.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -31852,8 +31852,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.BarRequest.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.BarRequest.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.BarRequest.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -31920,8 +31920,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.BarResponse { return try ProtobufUnittest.BarResponse.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.BarResponse { - return try ProtobufUnittest.BarResponse.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.BarResponse { + return try ProtobufUnittest.BarResponse.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -32011,8 +32011,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.BarResponse.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.BarResponse.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.BarResponse.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/ProtobufUnittest.UnittestCustomOptions.proto.swift b/plugin/Tests/pbTests/ProtobufUnittest.UnittestCustomOptions.proto.swift index 2e441a2..fd8b992 100644 --- a/plugin/Tests/pbTests/ProtobufUnittest.UnittestCustomOptions.proto.swift +++ b/plugin/Tests/pbTests/ProtobufUnittest.UnittestCustomOptions.proto.swift @@ -679,8 +679,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestMessageWithCustomOptions { return try ProtobufUnittest.TestMessageWithCustomOptions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestMessageWithCustomOptions { - return try ProtobufUnittest.TestMessageWithCustomOptions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageWithCustomOptions { + return try ProtobufUnittest.TestMessageWithCustomOptions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -810,8 +810,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestMessageWithCustomOptions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageWithCustomOptions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -880,8 +880,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.CustomOptionFooRequest { return try ProtobufUnittest.CustomOptionFooRequest.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.CustomOptionFooRequest { - return try ProtobufUnittest.CustomOptionFooRequest.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.CustomOptionFooRequest { + return try ProtobufUnittest.CustomOptionFooRequest.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -971,8 +971,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.CustomOptionFooRequest.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.CustomOptionFooRequest.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.CustomOptionFooRequest.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1039,8 +1039,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.CustomOptionFooResponse { return try ProtobufUnittest.CustomOptionFooResponse.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.CustomOptionFooResponse { - return try ProtobufUnittest.CustomOptionFooResponse.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.CustomOptionFooResponse { + return try ProtobufUnittest.CustomOptionFooResponse.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1130,8 +1130,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.CustomOptionFooResponse.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.CustomOptionFooResponse.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.CustomOptionFooResponse.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1198,8 +1198,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.CustomOptionFooClientMessage { return try ProtobufUnittest.CustomOptionFooClientMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.CustomOptionFooClientMessage { - return try ProtobufUnittest.CustomOptionFooClientMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.CustomOptionFooClientMessage { + return try ProtobufUnittest.CustomOptionFooClientMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1289,8 +1289,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.CustomOptionFooClientMessage.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.CustomOptionFooClientMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.CustomOptionFooClientMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1357,8 +1357,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.CustomOptionFooServerMessage { return try ProtobufUnittest.CustomOptionFooServerMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.CustomOptionFooServerMessage { - return try ProtobufUnittest.CustomOptionFooServerMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.CustomOptionFooServerMessage { + return try ProtobufUnittest.CustomOptionFooServerMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1448,8 +1448,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.CustomOptionFooServerMessage.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.CustomOptionFooServerMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.CustomOptionFooServerMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1554,8 +1554,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.DummyMessageContainingEnum { return try ProtobufUnittest.DummyMessageContainingEnum.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.DummyMessageContainingEnum { - return try ProtobufUnittest.DummyMessageContainingEnum.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.DummyMessageContainingEnum { + return try ProtobufUnittest.DummyMessageContainingEnum.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1645,8 +1645,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.DummyMessageContainingEnum.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.DummyMessageContainingEnum.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.DummyMessageContainingEnum.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1713,8 +1713,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.DummyMessageInvalidAsOptionType { return try ProtobufUnittest.DummyMessageInvalidAsOptionType.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.DummyMessageInvalidAsOptionType { - return try ProtobufUnittest.DummyMessageInvalidAsOptionType.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.DummyMessageInvalidAsOptionType { + return try ProtobufUnittest.DummyMessageInvalidAsOptionType.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1804,8 +1804,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.DummyMessageInvalidAsOptionType.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.DummyMessageInvalidAsOptionType.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.DummyMessageInvalidAsOptionType.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1872,8 +1872,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.CustomOptionMinIntegerValues { return try ProtobufUnittest.CustomOptionMinIntegerValues.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.CustomOptionMinIntegerValues { - return try ProtobufUnittest.CustomOptionMinIntegerValues.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.CustomOptionMinIntegerValues { + return try ProtobufUnittest.CustomOptionMinIntegerValues.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1963,8 +1963,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.CustomOptionMinIntegerValues.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.CustomOptionMinIntegerValues.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.CustomOptionMinIntegerValues.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -2031,8 +2031,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.CustomOptionMaxIntegerValues { return try ProtobufUnittest.CustomOptionMaxIntegerValues.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.CustomOptionMaxIntegerValues { - return try ProtobufUnittest.CustomOptionMaxIntegerValues.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.CustomOptionMaxIntegerValues { + return try ProtobufUnittest.CustomOptionMaxIntegerValues.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -2122,8 +2122,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.CustomOptionMaxIntegerValues.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.CustomOptionMaxIntegerValues.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.CustomOptionMaxIntegerValues.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -2190,8 +2190,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.CustomOptionOtherValues { return try ProtobufUnittest.CustomOptionOtherValues.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.CustomOptionOtherValues { - return try ProtobufUnittest.CustomOptionOtherValues.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.CustomOptionOtherValues { + return try ProtobufUnittest.CustomOptionOtherValues.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -2281,8 +2281,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.CustomOptionOtherValues.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.CustomOptionOtherValues.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.CustomOptionOtherValues.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -2349,8 +2349,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.SettingRealsFromPositiveInts { return try ProtobufUnittest.SettingRealsFromPositiveInts.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.SettingRealsFromPositiveInts { - return try ProtobufUnittest.SettingRealsFromPositiveInts.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.SettingRealsFromPositiveInts { + return try ProtobufUnittest.SettingRealsFromPositiveInts.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -2440,8 +2440,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.SettingRealsFromPositiveInts.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.SettingRealsFromPositiveInts.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.SettingRealsFromPositiveInts.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -2508,8 +2508,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.SettingRealsFromNegativeInts { return try ProtobufUnittest.SettingRealsFromNegativeInts.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.SettingRealsFromNegativeInts { - return try ProtobufUnittest.SettingRealsFromNegativeInts.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.SettingRealsFromNegativeInts { + return try ProtobufUnittest.SettingRealsFromNegativeInts.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -2599,8 +2599,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.SettingRealsFromNegativeInts.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.SettingRealsFromNegativeInts.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.SettingRealsFromNegativeInts.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -2729,8 +2729,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.ComplexOptionType1 { return try ProtobufUnittest.ComplexOptionType1.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.ComplexOptionType1 { - return try ProtobufUnittest.ComplexOptionType1.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.ComplexOptionType1 { + return try ProtobufUnittest.ComplexOptionType1.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -2988,8 +2988,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.ComplexOptionType1.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.ComplexOptionType1.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -3093,8 +3093,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.ComplexOptionType2.ComplexOptionType4 { return try ProtobufUnittest.ComplexOptionType2.ComplexOptionType4.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.ComplexOptionType2.ComplexOptionType4 { - return try ProtobufUnittest.ComplexOptionType2.ComplexOptionType4.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.ComplexOptionType2.ComplexOptionType4 { + return try ProtobufUnittest.ComplexOptionType2.ComplexOptionType4.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -3226,8 +3226,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.ComplexOptionType2.ComplexOptionType4.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.ComplexOptionType2.ComplexOptionType4.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -3342,8 +3342,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.ComplexOptionType2 { return try ProtobufUnittest.ComplexOptionType2.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.ComplexOptionType2 { - return try ProtobufUnittest.ComplexOptionType2.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.ComplexOptionType2 { + return try ProtobufUnittest.ComplexOptionType2.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -3685,8 +3685,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.ComplexOptionType2.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.ComplexOptionType2.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -3784,8 +3784,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.ComplexOptionType3.ComplexOptionType5 { return try ProtobufUnittest.ComplexOptionType3.ComplexOptionType5.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.ComplexOptionType3.ComplexOptionType5 { - return try ProtobufUnittest.ComplexOptionType3.ComplexOptionType5.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.ComplexOptionType3.ComplexOptionType5 { + return try ProtobufUnittest.ComplexOptionType3.ComplexOptionType5.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -3917,8 +3917,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.ComplexOptionType3.ComplexOptionType5.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.ComplexOptionType3.ComplexOptionType5.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -4000,8 +4000,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.ComplexOptionType3 { return try ProtobufUnittest.ComplexOptionType3.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.ComplexOptionType3 { - return try ProtobufUnittest.ComplexOptionType3.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.ComplexOptionType3 { + return try ProtobufUnittest.ComplexOptionType3.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -4214,8 +4214,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.ComplexOptionType3.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.ComplexOptionType3.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -4295,8 +4295,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.ComplexOpt6 { return try ProtobufUnittest.ComplexOpt6.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.ComplexOpt6 { - return try ProtobufUnittest.ComplexOpt6.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.ComplexOpt6 { + return try ProtobufUnittest.ComplexOpt6.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -4428,8 +4428,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.ComplexOpt6.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.ComplexOpt6.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -4497,8 +4497,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.VariousComplexOptions { return try ProtobufUnittest.VariousComplexOptions.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.VariousComplexOptions { - return try ProtobufUnittest.VariousComplexOptions.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.VariousComplexOptions { + return try ProtobufUnittest.VariousComplexOptions.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -4588,8 +4588,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.VariousComplexOptions.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.VariousComplexOptions.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.VariousComplexOptions.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -4659,8 +4659,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.AggregateMessageSet { return try ProtobufUnittest.AggregateMessageSet.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.AggregateMessageSet { - return try ProtobufUnittest.AggregateMessageSet.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.AggregateMessageSet { + return try ProtobufUnittest.AggregateMessageSet.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -4753,8 +4753,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.AggregateMessageSet.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.AggregateMessageSet.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.AggregateMessageSet.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -4837,8 +4837,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.AggregateMessageSetElement { return try ProtobufUnittest.AggregateMessageSetElement.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.AggregateMessageSetElement { - return try ProtobufUnittest.AggregateMessageSetElement.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.AggregateMessageSetElement { + return try ProtobufUnittest.AggregateMessageSetElement.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -4968,8 +4968,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.AggregateMessageSetElement.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.AggregateMessageSetElement.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -5117,8 +5117,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.Aggregate { return try ProtobufUnittest.Aggregate.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.Aggregate { - return try ProtobufUnittest.Aggregate.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.Aggregate { + return try ProtobufUnittest.Aggregate.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -5536,8 +5536,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.Aggregate.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.Aggregate.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -5617,8 +5617,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.AggregateMessage { return try ProtobufUnittest.AggregateMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.AggregateMessage { - return try ProtobufUnittest.AggregateMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.AggregateMessage { + return try ProtobufUnittest.AggregateMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -5750,8 +5750,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.AggregateMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.AggregateMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -5848,8 +5848,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.NestedOptionType.NestedMessage { return try ProtobufUnittest.NestedOptionType.NestedMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.NestedOptionType.NestedMessage { - return try ProtobufUnittest.NestedOptionType.NestedMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.NestedOptionType.NestedMessage { + return try ProtobufUnittest.NestedOptionType.NestedMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -5981,8 +5981,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.NestedOptionType.NestedMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.NestedOptionType.NestedMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -6076,8 +6076,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.NestedOptionType { return try ProtobufUnittest.NestedOptionType.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.NestedOptionType { - return try ProtobufUnittest.NestedOptionType.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.NestedOptionType { + return try ProtobufUnittest.NestedOptionType.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -6167,8 +6167,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.NestedOptionType.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.NestedOptionType.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.NestedOptionType.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/ProtobufUnittest.UnittestEmbedOptimizeFor.proto.swift b/plugin/Tests/pbTests/ProtobufUnittest.UnittestEmbedOptimizeFor.proto.swift index 0106ae7..d4d1a63 100644 --- a/plugin/Tests/pbTests/ProtobufUnittest.UnittestEmbedOptimizeFor.proto.swift +++ b/plugin/Tests/pbTests/ProtobufUnittest.UnittestEmbedOptimizeFor.proto.swift @@ -116,8 +116,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestEmbedOptimizedForSize { return try ProtobufUnittest.TestEmbedOptimizedForSize.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestEmbedOptimizedForSize { - return try ProtobufUnittest.TestEmbedOptimizedForSize.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestEmbedOptimizedForSize { + return try ProtobufUnittest.TestEmbedOptimizedForSize.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -335,8 +335,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestEmbedOptimizedForSize.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestEmbedOptimizedForSize.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/ProtobufUnittest.UnittestLite.proto.swift b/plugin/Tests/pbTests/ProtobufUnittest.UnittestLite.proto.swift index 23af9cd..7386395 100644 --- a/plugin/Tests/pbTests/ProtobufUnittest.UnittestLite.proto.swift +++ b/plugin/Tests/pbTests/ProtobufUnittest.UnittestLite.proto.swift @@ -1234,8 +1234,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestAllTypesLite.NestedMessage { return try ProtobufUnittest.TestAllTypesLite.NestedMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestAllTypesLite.NestedMessage { - return try ProtobufUnittest.TestAllTypesLite.NestedMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllTypesLite.NestedMessage { + return try ProtobufUnittest.TestAllTypesLite.NestedMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1367,8 +1367,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestAllTypesLite.NestedMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllTypesLite.NestedMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1454,8 +1454,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestAllTypesLite.OptionalGroup { return try ProtobufUnittest.TestAllTypesLite.OptionalGroup.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestAllTypesLite.OptionalGroup { - return try ProtobufUnittest.TestAllTypesLite.OptionalGroup.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllTypesLite.OptionalGroup { + return try ProtobufUnittest.TestAllTypesLite.OptionalGroup.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1587,8 +1587,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestAllTypesLite.OptionalGroup.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllTypesLite.OptionalGroup.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1674,8 +1674,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestAllTypesLite.RepeatedGroup { return try ProtobufUnittest.TestAllTypesLite.RepeatedGroup.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestAllTypesLite.RepeatedGroup { - return try ProtobufUnittest.TestAllTypesLite.RepeatedGroup.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllTypesLite.RepeatedGroup { + return try ProtobufUnittest.TestAllTypesLite.RepeatedGroup.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1807,8 +1807,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestAllTypesLite.RepeatedGroup.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllTypesLite.RepeatedGroup.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -3076,8 +3076,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestAllTypesLite { return try ProtobufUnittest.TestAllTypesLite.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestAllTypesLite { - return try ProtobufUnittest.TestAllTypesLite.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllTypesLite { + return try ProtobufUnittest.TestAllTypesLite.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -6565,8 +6565,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestAllTypesLite.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllTypesLite.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -6646,8 +6646,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.ForeignMessageLite { return try ProtobufUnittest.ForeignMessageLite.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.ForeignMessageLite { - return try ProtobufUnittest.ForeignMessageLite.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.ForeignMessageLite { + return try ProtobufUnittest.ForeignMessageLite.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -6779,8 +6779,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.ForeignMessageLite.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.ForeignMessageLite.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -7211,8 +7211,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestPackedTypesLite { return try ProtobufUnittest.TestPackedTypesLite.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestPackedTypesLite { - return try ProtobufUnittest.TestPackedTypesLite.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestPackedTypesLite { + return try ProtobufUnittest.TestPackedTypesLite.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -7924,8 +7924,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestPackedTypesLite.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestPackedTypesLite.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -7995,8 +7995,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestAllExtensionsLite { return try ProtobufUnittest.TestAllExtensionsLite.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestAllExtensionsLite { - return try ProtobufUnittest.TestAllExtensionsLite.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllExtensionsLite { + return try ProtobufUnittest.TestAllExtensionsLite.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -8089,8 +8089,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.TestAllExtensionsLite.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestAllExtensionsLite.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestAllExtensionsLite.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -8170,8 +8170,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.OptionalGroupExtensionLite { return try ProtobufUnittest.OptionalGroupExtensionLite.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.OptionalGroupExtensionLite { - return try ProtobufUnittest.OptionalGroupExtensionLite.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.OptionalGroupExtensionLite { + return try ProtobufUnittest.OptionalGroupExtensionLite.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -8303,8 +8303,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.OptionalGroupExtensionLite.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.OptionalGroupExtensionLite.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -8384,8 +8384,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.RepeatedGroupExtensionLite { return try ProtobufUnittest.RepeatedGroupExtensionLite.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.RepeatedGroupExtensionLite { - return try ProtobufUnittest.RepeatedGroupExtensionLite.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.RepeatedGroupExtensionLite { + return try ProtobufUnittest.RepeatedGroupExtensionLite.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -8517,8 +8517,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.RepeatedGroupExtensionLite.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.RepeatedGroupExtensionLite.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -8588,8 +8588,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestPackedExtensionsLite { return try ProtobufUnittest.TestPackedExtensionsLite.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestPackedExtensionsLite { - return try ProtobufUnittest.TestPackedExtensionsLite.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestPackedExtensionsLite { + return try ProtobufUnittest.TestPackedExtensionsLite.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -8682,8 +8682,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.TestPackedExtensionsLite.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestPackedExtensionsLite.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestPackedExtensionsLite.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -8753,8 +8753,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestNestedExtensionLite { return try ProtobufUnittest.TestNestedExtensionLite.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestNestedExtensionLite { - return try ProtobufUnittest.TestNestedExtensionLite.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestNestedExtensionLite { + return try ProtobufUnittest.TestNestedExtensionLite.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -8844,8 +8844,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.TestNestedExtensionLite.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestNestedExtensionLite.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestNestedExtensionLite.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -8928,8 +8928,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestDeprecatedLite { return try ProtobufUnittest.TestDeprecatedLite.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestDeprecatedLite { - return try ProtobufUnittest.TestDeprecatedLite.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestDeprecatedLite { + return try ProtobufUnittest.TestDeprecatedLite.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -9061,8 +9061,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestDeprecatedLite.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestDeprecatedLite.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -9189,8 +9189,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group1 { return try ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group1.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group1 { - return try ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group1.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group1 { + return try ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group1.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -9361,8 +9361,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group1.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group1.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -9449,8 +9449,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group2 { return try ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group2.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group2 { - return try ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group2.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group2 { + return try ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group2.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -9621,8 +9621,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group2.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Group2.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -9784,8 +9784,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator { return try ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator { - return try ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator { + return try ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -10190,8 +10190,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedFieldsGenerator.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -10278,8 +10278,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestParsingMergeLite.OptionalGroup { return try ProtobufUnittest.TestParsingMergeLite.OptionalGroup.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestParsingMergeLite.OptionalGroup { - return try ProtobufUnittest.TestParsingMergeLite.OptionalGroup.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMergeLite.OptionalGroup { + return try ProtobufUnittest.TestParsingMergeLite.OptionalGroup.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -10450,8 +10450,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestParsingMergeLite.OptionalGroup.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMergeLite.OptionalGroup.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -10538,8 +10538,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedGroup { return try ProtobufUnittest.TestParsingMergeLite.RepeatedGroup.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedGroup { - return try ProtobufUnittest.TestParsingMergeLite.RepeatedGroup.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedGroup { + return try ProtobufUnittest.TestParsingMergeLite.RepeatedGroup.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -10710,8 +10710,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedGroup.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMergeLite.RepeatedGroup.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -10848,8 +10848,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestParsingMergeLite { return try ProtobufUnittest.TestParsingMergeLite.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestParsingMergeLite { - return try ProtobufUnittest.TestParsingMergeLite.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMergeLite { + return try ProtobufUnittest.TestParsingMergeLite.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -11275,8 +11275,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestParsingMergeLite.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestParsingMergeLite.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -11344,8 +11344,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestEmptyMessageLite { return try ProtobufUnittest.TestEmptyMessageLite.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestEmptyMessageLite { - return try ProtobufUnittest.TestEmptyMessageLite.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestEmptyMessageLite { + return try ProtobufUnittest.TestEmptyMessageLite.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -11435,8 +11435,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.TestEmptyMessageLite.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestEmptyMessageLite.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestEmptyMessageLite.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -11508,8 +11508,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestEmptyMessageWithExtensionsLite { return try ProtobufUnittest.TestEmptyMessageWithExtensionsLite.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestEmptyMessageWithExtensionsLite { - return try ProtobufUnittest.TestEmptyMessageWithExtensionsLite.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestEmptyMessageWithExtensionsLite { + return try ProtobufUnittest.TestEmptyMessageWithExtensionsLite.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -11602,8 +11602,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.TestEmptyMessageWithExtensionsLite.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestEmptyMessageWithExtensionsLite.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestEmptyMessageWithExtensionsLite.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/ProtobufUnittest.UnittestLiteImportsNonlite.proto.swift b/plugin/Tests/pbTests/ProtobufUnittest.UnittestLiteImportsNonlite.proto.swift index 642605d..da7d879 100644 --- a/plugin/Tests/pbTests/ProtobufUnittest.UnittestLiteImportsNonlite.proto.swift +++ b/plugin/Tests/pbTests/ProtobufUnittest.UnittestLiteImportsNonlite.proto.swift @@ -94,8 +94,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestLiteImportsNonlite { return try ProtobufUnittest.TestLiteImportsNonlite.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestLiteImportsNonlite { - return try ProtobufUnittest.TestLiteImportsNonlite.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestLiteImportsNonlite { + return try ProtobufUnittest.TestLiteImportsNonlite.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -266,8 +266,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestLiteImportsNonlite.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestLiteImportsNonlite.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/ProtobufUnittest.UnittestMset.proto.swift b/plugin/Tests/pbTests/ProtobufUnittest.UnittestMset.proto.swift index b1e7aa1..b716ba1 100644 --- a/plugin/Tests/pbTests/ProtobufUnittest.UnittestMset.proto.swift +++ b/plugin/Tests/pbTests/ProtobufUnittest.UnittestMset.proto.swift @@ -99,8 +99,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestMessageSet { return try ProtobufUnittest.TestMessageSet.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestMessageSet { - return try ProtobufUnittest.TestMessageSet.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageSet { + return try ProtobufUnittest.TestMessageSet.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -193,8 +193,8 @@ public extension ProtobufUnittest { let resultDecodedBuilder = ProtobufUnittest.TestMessageSet.Builder() return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestMessageSet.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageSet.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -278,8 +278,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestMessageSetContainer { return try ProtobufUnittest.TestMessageSetContainer.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestMessageSetContainer { - return try ProtobufUnittest.TestMessageSetContainer.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageSetContainer { + return try ProtobufUnittest.TestMessageSetContainer.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -450,8 +450,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestMessageSetContainer.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageSetContainer.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -534,8 +534,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestMessageSetExtension1 { return try ProtobufUnittest.TestMessageSetExtension1.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestMessageSetExtension1 { - return try ProtobufUnittest.TestMessageSetExtension1.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageSetExtension1 { + return try ProtobufUnittest.TestMessageSetExtension1.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -667,8 +667,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestMessageSetExtension1.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageSetExtension1.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -751,8 +751,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestMessageSetExtension2 { return try ProtobufUnittest.TestMessageSetExtension2.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestMessageSetExtension2 { - return try ProtobufUnittest.TestMessageSetExtension2.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageSetExtension2 { + return try ProtobufUnittest.TestMessageSetExtension2.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -882,8 +882,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestMessageSetExtension2.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageSetExtension2.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1000,8 +1000,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.RawMessageSet.Item { return try ProtobufUnittest.RawMessageSet.Item.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.RawMessageSet.Item { - return try ProtobufUnittest.RawMessageSet.Item.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.RawMessageSet.Item { + return try ProtobufUnittest.RawMessageSet.Item.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1173,8 +1173,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.RawMessageSet.Item.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.RawMessageSet.Item.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1249,8 +1249,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.RawMessageSet { return try ProtobufUnittest.RawMessageSet.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.RawMessageSet { - return try ProtobufUnittest.RawMessageSet.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.RawMessageSet { + return try ProtobufUnittest.RawMessageSet.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1385,8 +1385,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.RawMessageSet.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.RawMessageSet.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/ProtobufUnittest.UnittestOptimizeFor.proto.swift b/plugin/Tests/pbTests/ProtobufUnittest.UnittestOptimizeFor.proto.swift index b0b4702..7236b25 100644 --- a/plugin/Tests/pbTests/ProtobufUnittest.UnittestOptimizeFor.proto.swift +++ b/plugin/Tests/pbTests/ProtobufUnittest.UnittestOptimizeFor.proto.swift @@ -231,8 +231,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestOptimizedForSize { return try ProtobufUnittest.TestOptimizedForSize.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestOptimizedForSize { - return try ProtobufUnittest.TestOptimizedForSize.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOptimizedForSize { + return try ProtobufUnittest.TestOptimizedForSize.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -534,8 +534,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestOptimizedForSize.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOptimizedForSize.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -618,8 +618,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestRequiredOptimizedForSize { return try ProtobufUnittest.TestRequiredOptimizedForSize.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestRequiredOptimizedForSize { - return try ProtobufUnittest.TestRequiredOptimizedForSize.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestRequiredOptimizedForSize { + return try ProtobufUnittest.TestRequiredOptimizedForSize.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -751,8 +751,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestRequiredOptimizedForSize.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestRequiredOptimizedForSize.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -836,8 +836,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestOptionalOptimizedForSize { return try ProtobufUnittest.TestOptionalOptimizedForSize.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestOptionalOptimizedForSize { - return try ProtobufUnittest.TestOptionalOptimizedForSize.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOptionalOptimizedForSize { + return try ProtobufUnittest.TestOptionalOptimizedForSize.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1008,8 +1008,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestOptionalOptimizedForSize.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestOptionalOptimizedForSize.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/ProtobufUnittest.UnittestWellKnownTypes.proto.swift b/plugin/Tests/pbTests/ProtobufUnittest.UnittestWellKnownTypes.proto.swift index 51a2827..f48ba8b 100644 --- a/plugin/Tests/pbTests/ProtobufUnittest.UnittestWellKnownTypes.proto.swift +++ b/plugin/Tests/pbTests/ProtobufUnittest.UnittestWellKnownTypes.proto.swift @@ -230,8 +230,8 @@ public extension ProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittest.TestWellKnownTypes { return try ProtobufUnittest.TestWellKnownTypes.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittest.TestWellKnownTypes { - return try ProtobufUnittest.TestWellKnownTypes.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestWellKnownTypes { + return try ProtobufUnittest.TestWellKnownTypes.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1131,8 +1131,8 @@ public extension ProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittest.TestWellKnownTypes.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestWellKnownTypes.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/ProtobufUnittestImport.UnittestImport.proto.swift b/plugin/Tests/pbTests/ProtobufUnittestImport.UnittestImport.proto.swift index 03bf48b..0faf165 100644 --- a/plugin/Tests/pbTests/ProtobufUnittestImport.UnittestImport.proto.swift +++ b/plugin/Tests/pbTests/ProtobufUnittestImport.UnittestImport.proto.swift @@ -135,8 +135,8 @@ public extension ProtobufUnittestImport { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittestImport.ImportMessage { return try ProtobufUnittestImport.ImportMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittestImport.ImportMessage { - return try ProtobufUnittestImport.ImportMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestImport.ImportMessage { + return try ProtobufUnittestImport.ImportMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -268,8 +268,8 @@ public extension ProtobufUnittestImport { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittestImport.ImportMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestImport.ImportMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/ProtobufUnittestImport.UnittestImportLite.proto.swift b/plugin/Tests/pbTests/ProtobufUnittestImport.UnittestImportLite.proto.swift index 63161f1..7663190 100644 --- a/plugin/Tests/pbTests/ProtobufUnittestImport.UnittestImportLite.proto.swift +++ b/plugin/Tests/pbTests/ProtobufUnittestImport.UnittestImportLite.proto.swift @@ -135,8 +135,8 @@ public extension ProtobufUnittestImport { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittestImport.ImportMessageLite { return try ProtobufUnittestImport.ImportMessageLite.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittestImport.ImportMessageLite { - return try ProtobufUnittestImport.ImportMessageLite.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestImport.ImportMessageLite { + return try ProtobufUnittestImport.ImportMessageLite.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -268,8 +268,8 @@ public extension ProtobufUnittestImport { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittestImport.ImportMessageLite.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestImport.ImportMessageLite.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/ProtobufUnittestImport.UnittestImportPublic.proto.swift b/plugin/Tests/pbTests/ProtobufUnittestImport.UnittestImportPublic.proto.swift index 90e1270..a655eb1 100644 --- a/plugin/Tests/pbTests/ProtobufUnittestImport.UnittestImportPublic.proto.swift +++ b/plugin/Tests/pbTests/ProtobufUnittestImport.UnittestImportPublic.proto.swift @@ -92,8 +92,8 @@ public extension ProtobufUnittestImport { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittestImport.PublicImportMessage { return try ProtobufUnittestImport.PublicImportMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittestImport.PublicImportMessage { - return try ProtobufUnittestImport.PublicImportMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestImport.PublicImportMessage { + return try ProtobufUnittestImport.PublicImportMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -225,8 +225,8 @@ public extension ProtobufUnittestImport { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittestImport.PublicImportMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestImport.PublicImportMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/ProtobufUnittestImport.UnittestImportPublicLite.proto.swift b/plugin/Tests/pbTests/ProtobufUnittestImport.UnittestImportPublicLite.proto.swift index 6460600..54bf17e 100644 --- a/plugin/Tests/pbTests/ProtobufUnittestImport.UnittestImportPublicLite.proto.swift +++ b/plugin/Tests/pbTests/ProtobufUnittestImport.UnittestImportPublicLite.proto.swift @@ -92,8 +92,8 @@ public extension ProtobufUnittestImport { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittestImport.PublicImportMessageLite { return try ProtobufUnittestImport.PublicImportMessageLite.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittestImport.PublicImportMessageLite { - return try ProtobufUnittestImport.PublicImportMessageLite.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestImport.PublicImportMessageLite { + return try ProtobufUnittestImport.PublicImportMessageLite.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -225,8 +225,8 @@ public extension ProtobufUnittestImport { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittestImport.PublicImportMessageLite.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestImport.PublicImportMessageLite.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/ProtobufUnittestNoArena.UnittestNoArena.proto.swift b/plugin/Tests/pbTests/ProtobufUnittestNoArena.UnittestNoArena.proto.swift index c67cac7..29fff20 100644 --- a/plugin/Tests/pbTests/ProtobufUnittestNoArena.UnittestNoArena.proto.swift +++ b/plugin/Tests/pbTests/ProtobufUnittestNoArena.UnittestNoArena.proto.swift @@ -233,8 +233,8 @@ public extension ProtobufUnittestNoArena { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittestNoArena.TestAllTypes.NestedMessage { return try ProtobufUnittestNoArena.TestAllTypes.NestedMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittestNoArena.TestAllTypes.NestedMessage { - return try ProtobufUnittestNoArena.TestAllTypes.NestedMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestNoArena.TestAllTypes.NestedMessage { + return try ProtobufUnittestNoArena.TestAllTypes.NestedMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -369,8 +369,8 @@ public extension ProtobufUnittestNoArena { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittestNoArena.TestAllTypes.NestedMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestNoArena.TestAllTypes.NestedMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -456,8 +456,8 @@ public extension ProtobufUnittestNoArena { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittestNoArena.TestAllTypes.OptionalGroup { return try ProtobufUnittestNoArena.TestAllTypes.OptionalGroup.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittestNoArena.TestAllTypes.OptionalGroup { - return try ProtobufUnittestNoArena.TestAllTypes.OptionalGroup.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestNoArena.TestAllTypes.OptionalGroup { + return try ProtobufUnittestNoArena.TestAllTypes.OptionalGroup.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -589,8 +589,8 @@ public extension ProtobufUnittestNoArena { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittestNoArena.TestAllTypes.OptionalGroup.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestNoArena.TestAllTypes.OptionalGroup.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -676,8 +676,8 @@ public extension ProtobufUnittestNoArena { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittestNoArena.TestAllTypes.RepeatedGroup { return try ProtobufUnittestNoArena.TestAllTypes.RepeatedGroup.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittestNoArena.TestAllTypes.RepeatedGroup { - return try ProtobufUnittestNoArena.TestAllTypes.RepeatedGroup.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestNoArena.TestAllTypes.RepeatedGroup { + return try ProtobufUnittestNoArena.TestAllTypes.RepeatedGroup.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -809,8 +809,8 @@ public extension ProtobufUnittestNoArena { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittestNoArena.TestAllTypes.RepeatedGroup.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestNoArena.TestAllTypes.RepeatedGroup.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -2124,8 +2124,8 @@ public extension ProtobufUnittestNoArena { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittestNoArena.TestAllTypes { return try ProtobufUnittestNoArena.TestAllTypes.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittestNoArena.TestAllTypes { - return try ProtobufUnittestNoArena.TestAllTypes.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestNoArena.TestAllTypes { + return try ProtobufUnittestNoArena.TestAllTypes.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -5694,8 +5694,8 @@ public extension ProtobufUnittestNoArena { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittestNoArena.TestAllTypes.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestNoArena.TestAllTypes.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -5777,8 +5777,8 @@ public extension ProtobufUnittestNoArena { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittestNoArena.ForeignMessage { return try ProtobufUnittestNoArena.ForeignMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittestNoArena.ForeignMessage { - return try ProtobufUnittestNoArena.ForeignMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestNoArena.ForeignMessage { + return try ProtobufUnittestNoArena.ForeignMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -5910,8 +5910,8 @@ public extension ProtobufUnittestNoArena { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittestNoArena.ForeignMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestNoArena.ForeignMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -5992,8 +5992,8 @@ public extension ProtobufUnittestNoArena { override class public func decode(jsonMap:Dictionary) throws -> ProtobufUnittestNoArena.TestNoArenaMessage { return try ProtobufUnittestNoArena.TestNoArenaMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ProtobufUnittestNoArena.TestNoArenaMessage { - return try ProtobufUnittestNoArena.TestNoArenaMessage.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestNoArena.TestNoArenaMessage { + return try ProtobufUnittestNoArena.TestNoArenaMessage.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -6164,8 +6164,8 @@ public extension ProtobufUnittestNoArena { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ProtobufUnittestNoArena.TestNoArenaMessage.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittestNoArena.TestNoArenaMessage.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/SwiftProtobufUnittest.UnittestMaps.proto.swift b/plugin/Tests/pbTests/SwiftProtobufUnittest.UnittestMaps.proto.swift index 301215e..05bc74a 100644 --- a/plugin/Tests/pbTests/SwiftProtobufUnittest.UnittestMaps.proto.swift +++ b/plugin/Tests/pbTests/SwiftProtobufUnittest.UnittestMaps.proto.swift @@ -92,8 +92,8 @@ public extension SwiftProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> SwiftProtobufUnittest.MapMessageValue { return try SwiftProtobufUnittest.MapMessageValue.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> SwiftProtobufUnittest.MapMessageValue { - return try SwiftProtobufUnittest.MapMessageValue.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> SwiftProtobufUnittest.MapMessageValue { + return try SwiftProtobufUnittest.MapMessageValue.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -225,8 +225,8 @@ public extension SwiftProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> SwiftProtobufUnittest.MapMessageValue.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> SwiftProtobufUnittest.MapMessageValue.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -341,8 +341,8 @@ public extension SwiftProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> SwiftProtobufUnittest.MessageContainsMap.MapInt32Int32Entry { return try SwiftProtobufUnittest.MessageContainsMap.MapInt32Int32Entry.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> SwiftProtobufUnittest.MessageContainsMap.MapInt32Int32Entry { - return try SwiftProtobufUnittest.MessageContainsMap.MapInt32Int32Entry.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> SwiftProtobufUnittest.MessageContainsMap.MapInt32Int32Entry { + return try SwiftProtobufUnittest.MessageContainsMap.MapInt32Int32Entry.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -516,8 +516,8 @@ public extension SwiftProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> SwiftProtobufUnittest.MessageContainsMap.MapInt32Int32Entry.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> SwiftProtobufUnittest.MessageContainsMap.MapInt32Int32Entry.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -616,8 +616,8 @@ public extension SwiftProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> SwiftProtobufUnittest.MessageContainsMap.MapInt64Int64Entry { return try SwiftProtobufUnittest.MessageContainsMap.MapInt64Int64Entry.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> SwiftProtobufUnittest.MessageContainsMap.MapInt64Int64Entry { - return try SwiftProtobufUnittest.MessageContainsMap.MapInt64Int64Entry.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> SwiftProtobufUnittest.MessageContainsMap.MapInt64Int64Entry { + return try SwiftProtobufUnittest.MessageContainsMap.MapInt64Int64Entry.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -791,8 +791,8 @@ public extension SwiftProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> SwiftProtobufUnittest.MessageContainsMap.MapInt64Int64Entry.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> SwiftProtobufUnittest.MessageContainsMap.MapInt64Int64Entry.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -891,8 +891,8 @@ public extension SwiftProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> SwiftProtobufUnittest.MessageContainsMap.MapStringStringEntry { return try SwiftProtobufUnittest.MessageContainsMap.MapStringStringEntry.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> SwiftProtobufUnittest.MessageContainsMap.MapStringStringEntry { - return try SwiftProtobufUnittest.MessageContainsMap.MapStringStringEntry.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> SwiftProtobufUnittest.MessageContainsMap.MapStringStringEntry { + return try SwiftProtobufUnittest.MessageContainsMap.MapStringStringEntry.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1062,8 +1062,8 @@ public extension SwiftProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> SwiftProtobufUnittest.MessageContainsMap.MapStringStringEntry.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> SwiftProtobufUnittest.MessageContainsMap.MapStringStringEntry.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1162,8 +1162,8 @@ public extension SwiftProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> SwiftProtobufUnittest.MessageContainsMap.MapStringBytesEntry { return try SwiftProtobufUnittest.MessageContainsMap.MapStringBytesEntry.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> SwiftProtobufUnittest.MessageContainsMap.MapStringBytesEntry { - return try SwiftProtobufUnittest.MessageContainsMap.MapStringBytesEntry.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> SwiftProtobufUnittest.MessageContainsMap.MapStringBytesEntry { + return try SwiftProtobufUnittest.MessageContainsMap.MapStringBytesEntry.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1333,8 +1333,8 @@ public extension SwiftProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> SwiftProtobufUnittest.MessageContainsMap.MapStringBytesEntry.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> SwiftProtobufUnittest.MessageContainsMap.MapStringBytesEntry.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1434,8 +1434,8 @@ public extension SwiftProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> SwiftProtobufUnittest.MessageContainsMap.MapStringMessageEntry { return try SwiftProtobufUnittest.MessageContainsMap.MapStringMessageEntry.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> SwiftProtobufUnittest.MessageContainsMap.MapStringMessageEntry { - return try SwiftProtobufUnittest.MessageContainsMap.MapStringMessageEntry.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> SwiftProtobufUnittest.MessageContainsMap.MapStringMessageEntry { + return try SwiftProtobufUnittest.MessageContainsMap.MapStringMessageEntry.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1646,8 +1646,8 @@ public extension SwiftProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> SwiftProtobufUnittest.MessageContainsMap.MapStringMessageEntry.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> SwiftProtobufUnittest.MessageContainsMap.MapStringMessageEntry.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1745,8 +1745,8 @@ public extension SwiftProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> SwiftProtobufUnittest.MessageContainsMap.MapInt32EnumEntry { return try SwiftProtobufUnittest.MessageContainsMap.MapInt32EnumEntry.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> SwiftProtobufUnittest.MessageContainsMap.MapInt32EnumEntry { - return try SwiftProtobufUnittest.MessageContainsMap.MapInt32EnumEntry.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> SwiftProtobufUnittest.MessageContainsMap.MapInt32EnumEntry { + return try SwiftProtobufUnittest.MessageContainsMap.MapInt32EnumEntry.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1923,8 +1923,8 @@ public extension SwiftProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> SwiftProtobufUnittest.MessageContainsMap.MapInt32EnumEntry.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> SwiftProtobufUnittest.MessageContainsMap.MapInt32EnumEntry.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -2151,8 +2151,8 @@ public extension SwiftProtobufUnittest { override class public func decode(jsonMap:Dictionary) throws -> SwiftProtobufUnittest.MessageContainsMap { return try SwiftProtobufUnittest.MessageContainsMap.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> SwiftProtobufUnittest.MessageContainsMap { - return try SwiftProtobufUnittest.MessageContainsMap.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> SwiftProtobufUnittest.MessageContainsMap { + return try SwiftProtobufUnittest.MessageContainsMap.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -2552,8 +2552,8 @@ public extension SwiftProtobufUnittest { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> SwiftProtobufUnittest.MessageContainsMap.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> SwiftProtobufUnittest.MessageContainsMap.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/UnittestDropUnknownFields.UnittestDropUnknownFields.proto.swift b/plugin/Tests/pbTests/UnittestDropUnknownFields.UnittestDropUnknownFields.proto.swift index c33cb29..cb99a14 100644 --- a/plugin/Tests/pbTests/UnittestDropUnknownFields.UnittestDropUnknownFields.proto.swift +++ b/plugin/Tests/pbTests/UnittestDropUnknownFields.UnittestDropUnknownFields.proto.swift @@ -146,8 +146,8 @@ public extension UnittestDropUnknownFields { override class public func decode(jsonMap:Dictionary) throws -> UnittestDropUnknownFields.Foo { return try UnittestDropUnknownFields.Foo.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> UnittestDropUnknownFields.Foo { - return try UnittestDropUnknownFields.Foo.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> UnittestDropUnknownFields.Foo { + return try UnittestDropUnknownFields.Foo.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -324,8 +324,8 @@ public extension UnittestDropUnknownFields { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> UnittestDropUnknownFields.Foo.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> UnittestDropUnknownFields.Foo.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -476,8 +476,8 @@ public extension UnittestDropUnknownFields { override class public func decode(jsonMap:Dictionary) throws -> UnittestDropUnknownFields.FooWithExtraFields { return try UnittestDropUnknownFields.FooWithExtraFields.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> UnittestDropUnknownFields.FooWithExtraFields { - return try UnittestDropUnknownFields.FooWithExtraFields.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> UnittestDropUnknownFields.FooWithExtraFields { + return try UnittestDropUnknownFields.FooWithExtraFields.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -696,8 +696,8 @@ public extension UnittestDropUnknownFields { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> UnittestDropUnknownFields.FooWithExtraFields.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> UnittestDropUnknownFields.FooWithExtraFields.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/UnittestErrorType.proto.swift b/plugin/Tests/pbTests/UnittestErrorType.proto.swift index 24e1e50..4463110 100644 --- a/plugin/Tests/pbTests/UnittestErrorType.proto.swift +++ b/plugin/Tests/pbTests/UnittestErrorType.proto.swift @@ -171,8 +171,8 @@ final public class UserProfile : GeneratedMessage { override class public func decode(jsonMap:Dictionary) throws -> UserProfile.Request { return try UserProfile.Request.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> UserProfile.Request { - return try UserProfile.Request.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> UserProfile.Request { + return try UserProfile.Request.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -302,8 +302,8 @@ final public class UserProfile : GeneratedMessage { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> UserProfile.Request.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> UserProfile.Request.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -419,8 +419,8 @@ final public class UserProfile : GeneratedMessage { override class public func decode(jsonMap:Dictionary) throws -> UserProfile.Response { return try UserProfile.Response.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> UserProfile.Response { - return try UserProfile.Response.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> UserProfile.Response { + return try UserProfile.Response.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -717,8 +717,8 @@ final public class UserProfile : GeneratedMessage { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> UserProfile.Response.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> UserProfile.Response.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -823,8 +823,8 @@ final public class UserProfile : GeneratedMessage { override class public func decode(jsonMap:Dictionary) throws -> UserProfile.Exception { return try UserProfile.Exception.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> UserProfile.Exception { - return try UserProfile.Exception.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> UserProfile.Exception { + return try UserProfile.Exception.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -996,8 +996,8 @@ final public class UserProfile : GeneratedMessage { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> UserProfile.Exception.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> UserProfile.Exception.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } @@ -1090,8 +1090,8 @@ final public class UserProfile : GeneratedMessage { override class public func decode(jsonMap:Dictionary) throws -> UserProfile { return try UserProfile.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> UserProfile { - return try UserProfile.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> UserProfile { + return try UserProfile.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -1301,8 +1301,8 @@ final public class UserProfile : GeneratedMessage { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> UserProfile.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> UserProfile.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/UnittestStruct.proto.swift b/plugin/Tests/pbTests/UnittestStruct.proto.swift index b0ad217..49f77c4 100644 --- a/plugin/Tests/pbTests/UnittestStruct.proto.swift +++ b/plugin/Tests/pbTests/UnittestStruct.proto.swift @@ -103,8 +103,8 @@ final public class UnitTestStruct : GeneratedMessage { override class public func decode(jsonMap:Dictionary) throws -> UnitTestStruct { return try UnitTestStruct.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> UnitTestStruct { - return try UnitTestStruct.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> UnitTestStruct { + return try UnitTestStruct.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -276,8 +276,8 @@ final public class UnitTestStruct : GeneratedMessage { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> UnitTestStruct.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> UnitTestStruct.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/Tests/pbTests/UnittestThreading.proto.swift b/plugin/Tests/pbTests/UnittestThreading.proto.swift index a8950da..0944a87 100644 --- a/plugin/Tests/pbTests/UnittestThreading.proto.swift +++ b/plugin/Tests/pbTests/UnittestThreading.proto.swift @@ -89,8 +89,8 @@ final public class ThreadingMessages : GeneratedMessage { override class public func decode(jsonMap:Dictionary) throws -> ThreadingMessages { return try ThreadingMessages.Builder.decodeToBuilder(jsonMap:jsonMap).build() } - override class public func fromJSON(data:Data) throws -> ThreadingMessages { - return try ThreadingMessages.Builder.fromJSONToBuilder(data:data).build() + override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ThreadingMessages { + return try ThreadingMessages.Builder.fromJSONToBuilder(data:data, options:options).build() } override public func getDescription(indent:String) throws -> String { var output = "" @@ -220,8 +220,8 @@ final public class ThreadingMessages : GeneratedMessage { } return resultDecodedBuilder } - override class public func fromJSONToBuilder(data:Data) throws -> ThreadingMessages.Builder { - let jsonData = try JSONSerialization.jsonObject(with:data) + override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ThreadingMessages.Builder { + let jsonData = try JSONSerialization.jsonObject(with:data, options: options) guard let jsDataCast = jsonData as? Dictionary else { throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data") } diff --git a/plugin/compiler/google/protobuf/descriptor.pb.cc b/plugin/compiler/google/protobuf/descriptor.pb.cc index ab1b499..33b7eaf 100644 --- a/plugin/compiler/google/protobuf/descriptor.pb.cc +++ b/plugin/compiler/google/protobuf/descriptor.pb.cc @@ -973,25 +973,29 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, swift_prefix_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, php_class_prefix_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, php_namespace_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, php_metadata_namespace_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, ruby_package_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, uninterpreted_option_), 0, 1, - 9, 10, 11, - 17, - 2, 12, + 19, + 2, 13, 14, 15, 16, - 8, + 17, + 18, 3, 4, 5, 6, 7, + 8, + 9, ~0u, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, _has_bits_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, _internal_metadata_), @@ -1159,20 +1163,20 @@ static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROT { 146, 154, sizeof(::google::protobuf::EnumValueDescriptorProto)}, { 157, 165, sizeof(::google::protobuf::ServiceDescriptorProto)}, { 168, 179, sizeof(::google::protobuf::MethodDescriptorProto)}, - { 185, 209, sizeof(::google::protobuf::FileOptions)}, - { 228, 238, sizeof(::google::protobuf::MessageOptions)}, - { 243, 255, sizeof(::google::protobuf::FieldOptions)}, - { 262, 268, sizeof(::google::protobuf::OneofOptions)}, - { 269, 277, sizeof(::google::protobuf::EnumOptions)}, - { 280, 287, sizeof(::google::protobuf::EnumValueOptions)}, - { 289, 296, sizeof(::google::protobuf::ServiceOptions)}, - { 298, 306, sizeof(::google::protobuf::MethodOptions)}, - { 309, 316, sizeof(::google::protobuf::UninterpretedOption_NamePart)}, - { 318, 330, sizeof(::google::protobuf::UninterpretedOption)}, - { 337, 347, sizeof(::google::protobuf::SourceCodeInfo_Location)}, - { 352, 358, sizeof(::google::protobuf::SourceCodeInfo)}, - { 359, 368, sizeof(::google::protobuf::GeneratedCodeInfo_Annotation)}, - { 372, 378, sizeof(::google::protobuf::GeneratedCodeInfo)}, + { 185, 211, sizeof(::google::protobuf::FileOptions)}, + { 232, 242, sizeof(::google::protobuf::MessageOptions)}, + { 247, 259, sizeof(::google::protobuf::FieldOptions)}, + { 266, 272, sizeof(::google::protobuf::OneofOptions)}, + { 273, 281, sizeof(::google::protobuf::EnumOptions)}, + { 284, 291, sizeof(::google::protobuf::EnumValueOptions)}, + { 293, 300, sizeof(::google::protobuf::ServiceOptions)}, + { 302, 310, sizeof(::google::protobuf::MethodOptions)}, + { 313, 320, sizeof(::google::protobuf::UninterpretedOption_NamePart)}, + { 322, 334, sizeof(::google::protobuf::UninterpretedOption)}, + { 341, 351, sizeof(::google::protobuf::SourceCodeInfo_Location)}, + { 356, 362, sizeof(::google::protobuf::SourceCodeInfo)}, + { 363, 372, sizeof(::google::protobuf::GeneratedCodeInfo_Annotation)}, + { 376, 382, sizeof(::google::protobuf::GeneratedCodeInfo)}, }; static ::google::protobuf::Message const * const file_default_instances[] = { @@ -1300,7 +1304,7 @@ void AddDescriptorsImpl() { "ut_type\030\003 \001(\t\022/\n\007options\030\004 \001(\0132\036.google." "protobuf.MethodOptions\022\037\n\020client_streami" "ng\030\005 \001(\010:\005false\022\037\n\020server_streaming\030\006 \001(" - "\010:\005false\"\360\005\n\013FileOptions\022\024\n\014java_package" + "\010:\005false\"\246\006\n\013FileOptions\022\024\n\014java_package" "\030\001 \001(\t\022\034\n\024java_outer_classname\030\010 \001(\t\022\"\n\023" "java_multiple_files\030\n \001(\010:\005false\022)\n\035java" "_generate_equals_and_hash\030\024 \001(\010B\002\030\001\022%\n\026j" @@ -1315,71 +1319,72 @@ void AddDescriptorsImpl() { "\030\037 \001(\010:\005false\022\031\n\021objc_class_prefix\030$ \001(\t" "\022\030\n\020csharp_namespace\030% \001(\t\022\024\n\014swift_pref" "ix\030\' \001(\t\022\030\n\020php_class_prefix\030( \001(\t\022\025\n\rph" - "p_namespace\030) \001(\t\022C\n\024uninterpreted_optio" + "p_namespace\030) \001(\t\022\036\n\026php_metadata_namesp" + "ace\030, \001(\t\022\024\n\014ruby_package\030- \001(\t\022C\n\024unint" + "erpreted_option\030\347\007 \003(\0132$.google.protobuf" + ".UninterpretedOption\":\n\014OptimizeMode\022\t\n\005" + "SPEED\020\001\022\r\n\tCODE_SIZE\020\002\022\020\n\014LITE_RUNTIME\020\003" + "*\t\010\350\007\020\200\200\200\200\002J\004\010&\020\'\"\362\001\n\016MessageOptions\022&\n\027" + "message_set_wire_format\030\001 \001(\010:\005false\022.\n\037" + "no_standard_descriptor_accessor\030\002 \001(\010:\005f" + "alse\022\031\n\ndeprecated\030\003 \001(\010:\005false\022\021\n\tmap_e" + "ntry\030\007 \001(\010\022C\n\024uninterpreted_option\030\347\007 \003(" + "\0132$.google.protobuf.UninterpretedOption*" + "\t\010\350\007\020\200\200\200\200\002J\004\010\010\020\tJ\004\010\t\020\n\"\236\003\n\014FieldOptions\022" + ":\n\005ctype\030\001 \001(\0162#.google.protobuf.FieldOp" + "tions.CType:\006STRING\022\016\n\006packed\030\002 \001(\010\022\?\n\006j" + "stype\030\006 \001(\0162$.google.protobuf.FieldOptio" + "ns.JSType:\tJS_NORMAL\022\023\n\004lazy\030\005 \001(\010:\005fals" + "e\022\031\n\ndeprecated\030\003 \001(\010:\005false\022\023\n\004weak\030\n \001" + "(\010:\005false\022C\n\024uninterpreted_option\030\347\007 \003(\013" + "2$.google.protobuf.UninterpretedOption\"/" + "\n\005CType\022\n\n\006STRING\020\000\022\010\n\004CORD\020\001\022\020\n\014STRING_" + "PIECE\020\002\"5\n\006JSType\022\r\n\tJS_NORMAL\020\000\022\r\n\tJS_S" + "TRING\020\001\022\r\n\tJS_NUMBER\020\002*\t\010\350\007\020\200\200\200\200\002J\004\010\004\020\005\"" + "^\n\014OneofOptions\022C\n\024uninterpreted_option\030" + "\347\007 \003(\0132$.google.protobuf.UninterpretedOp" + "tion*\t\010\350\007\020\200\200\200\200\002\"\223\001\n\013EnumOptions\022\023\n\013allow" + "_alias\030\002 \001(\010\022\031\n\ndeprecated\030\003 \001(\010:\005false\022" + "C\n\024uninterpreted_option\030\347\007 \003(\0132$.google." + "protobuf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002J" + "\004\010\005\020\006\"}\n\020EnumValueOptions\022\031\n\ndeprecated\030" + "\001 \001(\010:\005false\022C\n\024uninterpreted_option\030\347\007 " + "\003(\0132$.google.protobuf.UninterpretedOptio" + "n*\t\010\350\007\020\200\200\200\200\002\"{\n\016ServiceOptions\022\031\n\ndeprec" + "ated\030! \001(\010:\005false\022C\n\024uninterpreted_optio" "n\030\347\007 \003(\0132$.google.protobuf.Uninterpreted" - "Option\":\n\014OptimizeMode\022\t\n\005SPEED\020\001\022\r\n\tCOD" - "E_SIZE\020\002\022\020\n\014LITE_RUNTIME\020\003*\t\010\350\007\020\200\200\200\200\002J\004\010" - "&\020\'\"\362\001\n\016MessageOptions\022&\n\027message_set_wi" - "re_format\030\001 \001(\010:\005false\022.\n\037no_standard_de" - "scriptor_accessor\030\002 \001(\010:\005false\022\031\n\ndeprec" - "ated\030\003 \001(\010:\005false\022\021\n\tmap_entry\030\007 \001(\010\022C\n\024" - "uninterpreted_option\030\347\007 \003(\0132$.google.pro" - "tobuf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002J\004\010\010" - "\020\tJ\004\010\t\020\n\"\236\003\n\014FieldOptions\022:\n\005ctype\030\001 \001(\016" - "2#.google.protobuf.FieldOptions.CType:\006S" - "TRING\022\016\n\006packed\030\002 \001(\010\022\?\n\006jstype\030\006 \001(\0162$." - "google.protobuf.FieldOptions.JSType:\tJS_" - "NORMAL\022\023\n\004lazy\030\005 \001(\010:\005false\022\031\n\ndeprecate" - "d\030\003 \001(\010:\005false\022\023\n\004weak\030\n \001(\010:\005false\022C\n\024u" - "ninterpreted_option\030\347\007 \003(\0132$.google.prot" - "obuf.UninterpretedOption\"/\n\005CType\022\n\n\006STR" - "ING\020\000\022\010\n\004CORD\020\001\022\020\n\014STRING_PIECE\020\002\"5\n\006JST" - "ype\022\r\n\tJS_NORMAL\020\000\022\r\n\tJS_STRING\020\001\022\r\n\tJS_" - "NUMBER\020\002*\t\010\350\007\020\200\200\200\200\002J\004\010\004\020\005\"^\n\014OneofOption" - "s\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.googl" - "e.protobuf.UninterpretedOption*\t\010\350\007\020\200\200\200\200" - "\002\"\223\001\n\013EnumOptions\022\023\n\013allow_alias\030\002 \001(\010\022\031" - "\n\ndeprecated\030\003 \001(\010:\005false\022C\n\024uninterpret" - "ed_option\030\347\007 \003(\0132$.google.protobuf.Unint" - "erpretedOption*\t\010\350\007\020\200\200\200\200\002J\004\010\005\020\006\"}\n\020EnumV" - "alueOptions\022\031\n\ndeprecated\030\001 \001(\010:\005false\022C" - "\n\024uninterpreted_option\030\347\007 \003(\0132$.google.p" - "rotobuf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"{" - "\n\016ServiceOptions\022\031\n\ndeprecated\030! \001(\010:\005fa" - "lse\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.goo" - "gle.protobuf.UninterpretedOption*\t\010\350\007\020\200\200" - "\200\200\002\"\255\002\n\rMethodOptions\022\031\n\ndeprecated\030! \001(" - "\010:\005false\022_\n\021idempotency_level\030\" \001(\0162/.go" - "ogle.protobuf.MethodOptions.IdempotencyL" - "evel:\023IDEMPOTENCY_UNKNOWN\022C\n\024uninterpret" - "ed_option\030\347\007 \003(\0132$.google.protobuf.Unint" - "erpretedOption\"P\n\020IdempotencyLevel\022\027\n\023ID" - "EMPOTENCY_UNKNOWN\020\000\022\023\n\017NO_SIDE_EFFECTS\020\001" - "\022\016\n\nIDEMPOTENT\020\002*\t\010\350\007\020\200\200\200\200\002\"\236\002\n\023Uninterp" - "retedOption\022;\n\004name\030\002 \003(\0132-.google.proto" - "buf.UninterpretedOption.NamePart\022\030\n\020iden" - "tifier_value\030\003 \001(\t\022\032\n\022positive_int_value" - "\030\004 \001(\004\022\032\n\022negative_int_value\030\005 \001(\003\022\024\n\014do" - "uble_value\030\006 \001(\001\022\024\n\014string_value\030\007 \001(\014\022\027" - "\n\017aggregate_value\030\010 \001(\t\0323\n\010NamePart\022\021\n\tn" - "ame_part\030\001 \002(\t\022\024\n\014is_extension\030\002 \002(\010\"\325\001\n" - "\016SourceCodeInfo\022:\n\010location\030\001 \003(\0132(.goog" - "le.protobuf.SourceCodeInfo.Location\032\206\001\n\010" - "Location\022\020\n\004path\030\001 \003(\005B\002\020\001\022\020\n\004span\030\002 \003(\005" - "B\002\020\001\022\030\n\020leading_comments\030\003 \001(\t\022\031\n\021traili" - "ng_comments\030\004 \001(\t\022!\n\031leading_detached_co" - "mments\030\006 \003(\t\"\247\001\n\021GeneratedCodeInfo\022A\n\nan" - "notation\030\001 \003(\0132-.google.protobuf.Generat" - "edCodeInfo.Annotation\032O\n\nAnnotation\022\020\n\004p" - "ath\030\001 \003(\005B\002\020\001\022\023\n\013source_file\030\002 \001(\t\022\r\n\005be" - "gin\030\003 \001(\005\022\013\n\003end\030\004 \001(\005B\217\001\n\023com.google.pr" - "otobufB\020DescriptorProtosH\001Z>github.com/g" - "olang/protobuf/protoc-gen-go/descriptor;" - "descriptor\370\001\001\242\002\003GPB\252\002\032Google.Protobuf.Re" - "flection" + "Option*\t\010\350\007\020\200\200\200\200\002\"\255\002\n\rMethodOptions\022\031\n\nd" + "eprecated\030! \001(\010:\005false\022_\n\021idempotency_le" + "vel\030\" \001(\0162/.google.protobuf.MethodOption" + "s.IdempotencyLevel:\023IDEMPOTENCY_UNKNOWN\022" + "C\n\024uninterpreted_option\030\347\007 \003(\0132$.google." + "protobuf.UninterpretedOption\"P\n\020Idempote" + "ncyLevel\022\027\n\023IDEMPOTENCY_UNKNOWN\020\000\022\023\n\017NO_" + "SIDE_EFFECTS\020\001\022\016\n\nIDEMPOTENT\020\002*\t\010\350\007\020\200\200\200\200" + "\002\"\236\002\n\023UninterpretedOption\022;\n\004name\030\002 \003(\0132" + "-.google.protobuf.UninterpretedOption.Na" + "mePart\022\030\n\020identifier_value\030\003 \001(\t\022\032\n\022posi" + "tive_int_value\030\004 \001(\004\022\032\n\022negative_int_val" + "ue\030\005 \001(\003\022\024\n\014double_value\030\006 \001(\001\022\024\n\014string" + "_value\030\007 \001(\014\022\027\n\017aggregate_value\030\010 \001(\t\0323\n" + "\010NamePart\022\021\n\tname_part\030\001 \002(\t\022\024\n\014is_exten" + "sion\030\002 \002(\010\"\325\001\n\016SourceCodeInfo\022:\n\010locatio" + "n\030\001 \003(\0132(.google.protobuf.SourceCodeInfo" + ".Location\032\206\001\n\010Location\022\020\n\004path\030\001 \003(\005B\002\020\001" + "\022\020\n\004span\030\002 \003(\005B\002\020\001\022\030\n\020leading_comments\030\003" + " \001(\t\022\031\n\021trailing_comments\030\004 \001(\t\022!\n\031leadi" + "ng_detached_comments\030\006 \003(\t\"\247\001\n\021Generated" + "CodeInfo\022A\n\nannotation\030\001 \003(\0132-.google.pr" + "otobuf.GeneratedCodeInfo.Annotation\032O\n\nA" + "nnotation\022\020\n\004path\030\001 \003(\005B\002\020\001\022\023\n\013source_fi" + "le\030\002 \001(\t\022\r\n\005begin\030\003 \001(\005\022\013\n\003end\030\004 \001(\005B\217\001\n" + "\023com.google.protobufB\020DescriptorProtosH\001" + "Z>github.com/golang/protobuf/protoc-gen-" + "go/descriptor;descriptor\370\001\001\242\002\003GPB\252\002\032Goog" + "le.Protobuf.Reflection" }; ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( - descriptor, 5968); + descriptor, 6022); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/descriptor.proto", &protobuf_RegisterTypes); } @@ -7832,6 +7837,8 @@ const int FileOptions::kCsharpNamespaceFieldNumber; const int FileOptions::kSwiftPrefixFieldNumber; const int FileOptions::kPhpClassPrefixFieldNumber; const int FileOptions::kPhpNamespaceFieldNumber; +const int FileOptions::kPhpMetadataNamespaceFieldNumber; +const int FileOptions::kRubyPackageFieldNumber; const int FileOptions::kUninterpretedOptionFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 @@ -7901,9 +7908,19 @@ FileOptions::FileOptions(const FileOptions& from) php_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.php_namespace(), GetArenaNoVirtual()); } - ::memcpy(&cc_enable_arenas_, &from.cc_enable_arenas_, + php_metadata_namespace_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_php_metadata_namespace()) { + php_metadata_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.php_metadata_namespace(), + GetArenaNoVirtual()); + } + ruby_package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_ruby_package()) { + ruby_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.ruby_package(), + GetArenaNoVirtual()); + } + ::memcpy(&java_multiple_files_, &from.java_multiple_files_, static_cast(reinterpret_cast(&optimize_for_) - - reinterpret_cast(&cc_enable_arenas_)) + sizeof(optimize_for_)); + reinterpret_cast(&java_multiple_files_)) + sizeof(optimize_for_)); // @@protoc_insertion_point(copy_constructor:google.protobuf.FileOptions) } @@ -7917,9 +7934,11 @@ void FileOptions::SharedCtor() { swift_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); php_class_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); php_namespace_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - ::memset(&cc_enable_arenas_, 0, static_cast( - reinterpret_cast(&deprecated_) - - reinterpret_cast(&cc_enable_arenas_)) + sizeof(deprecated_)); + php_metadata_namespace_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ruby_package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&java_multiple_files_, 0, static_cast( + reinterpret_cast(&cc_enable_arenas_) - + reinterpret_cast(&java_multiple_files_)) + sizeof(cc_enable_arenas_)); optimize_for_ = 1; } @@ -7938,6 +7957,8 @@ void FileOptions::SharedDtor() { swift_prefix_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); php_class_prefix_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); php_namespace_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + php_metadata_namespace_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ruby_package_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void FileOptions::ArenaDtor(void* object) { @@ -8008,13 +8029,25 @@ void FileOptions::Clear() { php_namespace_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } } - if (cached_has_bits & 65280u) { - ::memset(&cc_enable_arenas_, 0, static_cast( - reinterpret_cast(&php_generic_services_) - - reinterpret_cast(&cc_enable_arenas_)) + sizeof(php_generic_services_)); + if (cached_has_bits & 768u) { + if (cached_has_bits & 0x00000100u) { + GOOGLE_DCHECK(!php_metadata_namespace_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); + php_metadata_namespace_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } + if (cached_has_bits & 0x00000200u) { + GOOGLE_DCHECK(!ruby_package_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); + ruby_package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } + } + if (cached_has_bits & 64512u) { + ::memset(&java_multiple_files_, 0, static_cast( + reinterpret_cast(&py_generic_services_) - + reinterpret_cast(&java_multiple_files_)) + sizeof(py_generic_services_)); } - if (cached_has_bits & 196608u) { - deprecated_ = false; + if (cached_has_bits & 983040u) { + ::memset(&php_generic_services_, 0, static_cast( + reinterpret_cast(&cc_enable_arenas_) - + reinterpret_cast(&php_generic_services_)) + sizeof(cc_enable_arenas_)); optimize_for_ = 1; } _has_bits_.Clear(); @@ -8305,6 +8338,38 @@ bool FileOptions::MergePartialFromCodedStream( break; } + // optional string php_metadata_namespace = 44; + case 44: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(98u /* 354 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_php_metadata_namespace())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->php_metadata_namespace().data(), static_cast(this->php_metadata_namespace().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FileOptions.php_metadata_namespace"); + } else { + goto handle_unusual; + } + break; + } + + // optional string ruby_package = 45; + case 45: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(106u /* 362 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_ruby_package())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->ruby_package().data(), static_cast(this->ruby_package().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FileOptions.ruby_package"); + } else { + goto handle_unusual; + } + break; + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; case 999: { if (static_cast< ::google::protobuf::uint8>(tag) == @@ -8370,13 +8435,13 @@ void FileOptions::SerializeWithCachedSizes( } // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; - if (cached_has_bits & 0x00020000u) { + if (cached_has_bits & 0x00080000u) { ::google::protobuf::internal::WireFormatLite::WriteEnum( 9, this->optimize_for(), output); } // optional bool java_multiple_files = 10 [default = false]; - if (cached_has_bits & 0x00000200u) { + if (cached_has_bits & 0x00000400u) { ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->java_multiple_files(), output); } @@ -8391,37 +8456,37 @@ void FileOptions::SerializeWithCachedSizes( } // optional bool cc_generic_services = 16 [default = false]; - if (cached_has_bits & 0x00001000u) { + if (cached_has_bits & 0x00002000u) { ::google::protobuf::internal::WireFormatLite::WriteBool(16, this->cc_generic_services(), output); } // optional bool java_generic_services = 17 [default = false]; - if (cached_has_bits & 0x00002000u) { + if (cached_has_bits & 0x00004000u) { ::google::protobuf::internal::WireFormatLite::WriteBool(17, this->java_generic_services(), output); } // optional bool py_generic_services = 18 [default = false]; - if (cached_has_bits & 0x00004000u) { + if (cached_has_bits & 0x00008000u) { ::google::protobuf::internal::WireFormatLite::WriteBool(18, this->py_generic_services(), output); } // optional bool java_generate_equals_and_hash = 20 [deprecated = true]; - if (cached_has_bits & 0x00000400u) { + if (cached_has_bits & 0x00000800u) { ::google::protobuf::internal::WireFormatLite::WriteBool(20, this->java_generate_equals_and_hash(), output); } // optional bool deprecated = 23 [default = false]; - if (cached_has_bits & 0x00010000u) { + if (cached_has_bits & 0x00020000u) { ::google::protobuf::internal::WireFormatLite::WriteBool(23, this->deprecated(), output); } // optional bool java_string_check_utf8 = 27 [default = false]; - if (cached_has_bits & 0x00000800u) { + if (cached_has_bits & 0x00001000u) { ::google::protobuf::internal::WireFormatLite::WriteBool(27, this->java_string_check_utf8(), output); } // optional bool cc_enable_arenas = 31 [default = false]; - if (cached_has_bits & 0x00000100u) { + if (cached_has_bits & 0x00040000u) { ::google::protobuf::internal::WireFormatLite::WriteBool(31, this->cc_enable_arenas(), output); } @@ -8476,10 +8541,30 @@ void FileOptions::SerializeWithCachedSizes( } // optional bool php_generic_services = 42 [default = false]; - if (cached_has_bits & 0x00008000u) { + if (cached_has_bits & 0x00010000u) { ::google::protobuf::internal::WireFormatLite::WriteBool(42, this->php_generic_services(), output); } + // optional string php_metadata_namespace = 44; + if (cached_has_bits & 0x00000100u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->php_metadata_namespace().data(), static_cast(this->php_metadata_namespace().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileOptions.php_metadata_namespace"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 44, this->php_metadata_namespace(), output); + } + + // optional string ruby_package = 45; + if (cached_has_bits & 0x00000200u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->ruby_package().data(), static_cast(this->ruby_package().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileOptions.ruby_package"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 45, this->ruby_package(), output); + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; for (unsigned int i = 0, n = static_cast(this->uninterpreted_option_size()); i < n; i++) { @@ -8529,13 +8614,13 @@ ::google::protobuf::uint8* FileOptions::InternalSerializeWithCachedSizesToArray( } // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; - if (cached_has_bits & 0x00020000u) { + if (cached_has_bits & 0x00080000u) { target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( 9, this->optimize_for(), target); } // optional bool java_multiple_files = 10 [default = false]; - if (cached_has_bits & 0x00000200u) { + if (cached_has_bits & 0x00000400u) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->java_multiple_files(), target); } @@ -8551,37 +8636,37 @@ ::google::protobuf::uint8* FileOptions::InternalSerializeWithCachedSizesToArray( } // optional bool cc_generic_services = 16 [default = false]; - if (cached_has_bits & 0x00001000u) { + if (cached_has_bits & 0x00002000u) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(16, this->cc_generic_services(), target); } // optional bool java_generic_services = 17 [default = false]; - if (cached_has_bits & 0x00002000u) { + if (cached_has_bits & 0x00004000u) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(17, this->java_generic_services(), target); } // optional bool py_generic_services = 18 [default = false]; - if (cached_has_bits & 0x00004000u) { + if (cached_has_bits & 0x00008000u) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(18, this->py_generic_services(), target); } // optional bool java_generate_equals_and_hash = 20 [deprecated = true]; - if (cached_has_bits & 0x00000400u) { + if (cached_has_bits & 0x00000800u) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(20, this->java_generate_equals_and_hash(), target); } // optional bool deprecated = 23 [default = false]; - if (cached_has_bits & 0x00010000u) { + if (cached_has_bits & 0x00020000u) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(23, this->deprecated(), target); } // optional bool java_string_check_utf8 = 27 [default = false]; - if (cached_has_bits & 0x00000800u) { + if (cached_has_bits & 0x00001000u) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(27, this->java_string_check_utf8(), target); } // optional bool cc_enable_arenas = 31 [default = false]; - if (cached_has_bits & 0x00000100u) { + if (cached_has_bits & 0x00040000u) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(31, this->cc_enable_arenas(), target); } @@ -8641,10 +8726,32 @@ ::google::protobuf::uint8* FileOptions::InternalSerializeWithCachedSizesToArray( } // optional bool php_generic_services = 42 [default = false]; - if (cached_has_bits & 0x00008000u) { + if (cached_has_bits & 0x00010000u) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(42, this->php_generic_services(), target); } + // optional string php_metadata_namespace = 44; + if (cached_has_bits & 0x00000100u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->php_metadata_namespace().data(), static_cast(this->php_metadata_namespace().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileOptions.php_metadata_namespace"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 44, this->php_metadata_namespace(), target); + } + + // optional string ruby_package = 45; + if (cached_has_bits & 0x00000200u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->ruby_package().data(), static_cast(this->ruby_package().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileOptions.ruby_package"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 45, this->ruby_package(), target); + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; for (unsigned int i = 0, n = static_cast(this->uninterpreted_option_size()); i < n; i++) { @@ -8746,9 +8853,18 @@ size_t FileOptions::ByteSizeLong() const { } if (_has_bits_[8 / 32] & 65280u) { - // optional bool cc_enable_arenas = 31 [default = false]; - if (has_cc_enable_arenas()) { - total_size += 2 + 1; + // optional string php_metadata_namespace = 44; + if (has_php_metadata_namespace()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->php_metadata_namespace()); + } + + // optional string ruby_package = 45; + if (has_ruby_package()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->ruby_package()); } // optional bool java_multiple_files = 10 [default = false]; @@ -8781,18 +8897,23 @@ size_t FileOptions::ByteSizeLong() const { total_size += 2 + 1; } + } + if (_has_bits_[16 / 32] & 983040u) { // optional bool php_generic_services = 42 [default = false]; if (has_php_generic_services()) { total_size += 2 + 1; } - } - if (_has_bits_[16 / 32] & 196608u) { // optional bool deprecated = 23 [default = false]; if (has_deprecated()) { total_size += 2 + 1; } + // optional bool cc_enable_arenas = 31 [default = false]; + if (has_cc_enable_arenas()) { + total_size += 2 + 1; + } + // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; if (has_optimize_for()) { total_size += 1 + @@ -8860,36 +8981,42 @@ void FileOptions::MergeFrom(const FileOptions& from) { } if (cached_has_bits & 65280u) { if (cached_has_bits & 0x00000100u) { - cc_enable_arenas_ = from.cc_enable_arenas_; + set_php_metadata_namespace(from.php_metadata_namespace()); } if (cached_has_bits & 0x00000200u) { - java_multiple_files_ = from.java_multiple_files_; + set_ruby_package(from.ruby_package()); } if (cached_has_bits & 0x00000400u) { - java_generate_equals_and_hash_ = from.java_generate_equals_and_hash_; + java_multiple_files_ = from.java_multiple_files_; } if (cached_has_bits & 0x00000800u) { - java_string_check_utf8_ = from.java_string_check_utf8_; + java_generate_equals_and_hash_ = from.java_generate_equals_and_hash_; } if (cached_has_bits & 0x00001000u) { - cc_generic_services_ = from.cc_generic_services_; + java_string_check_utf8_ = from.java_string_check_utf8_; } if (cached_has_bits & 0x00002000u) { - java_generic_services_ = from.java_generic_services_; + cc_generic_services_ = from.cc_generic_services_; } if (cached_has_bits & 0x00004000u) { - py_generic_services_ = from.py_generic_services_; + java_generic_services_ = from.java_generic_services_; } if (cached_has_bits & 0x00008000u) { - php_generic_services_ = from.php_generic_services_; + py_generic_services_ = from.py_generic_services_; } _has_bits_[0] |= cached_has_bits; } - if (cached_has_bits & 196608u) { + if (cached_has_bits & 983040u) { if (cached_has_bits & 0x00010000u) { - deprecated_ = from.deprecated_; + php_generic_services_ = from.php_generic_services_; } if (cached_has_bits & 0x00020000u) { + deprecated_ = from.deprecated_; + } + if (cached_has_bits & 0x00040000u) { + cc_enable_arenas_ = from.cc_enable_arenas_; + } + if (cached_has_bits & 0x00080000u) { optimize_for_ = from.optimize_for_; } _has_bits_[0] |= cached_has_bits; @@ -8949,7 +9076,8 @@ void FileOptions::InternalSwap(FileOptions* other) { swift_prefix_.Swap(&other->swift_prefix_); php_class_prefix_.Swap(&other->php_class_prefix_); php_namespace_.Swap(&other->php_namespace_); - swap(cc_enable_arenas_, other->cc_enable_arenas_); + php_metadata_namespace_.Swap(&other->php_metadata_namespace_); + ruby_package_.Swap(&other->ruby_package_); swap(java_multiple_files_, other->java_multiple_files_); swap(java_generate_equals_and_hash_, other->java_generate_equals_and_hash_); swap(java_string_check_utf8_, other->java_string_check_utf8_); @@ -8958,6 +9086,7 @@ void FileOptions::InternalSwap(FileOptions* other) { swap(py_generic_services_, other->py_generic_services_); swap(php_generic_services_, other->php_generic_services_); swap(deprecated_, other->deprecated_); + swap(cc_enable_arenas_, other->cc_enable_arenas_); swap(optimize_for_, other->optimize_for_); swap(_has_bits_[0], other->_has_bits_[0]); _internal_metadata_.Swap(&other->_internal_metadata_); diff --git a/plugin/compiler/google/protobuf/descriptor.pb.h b/plugin/compiler/google/protobuf/descriptor.pb.h index cff8985..cd82a2b 100644 --- a/plugin/compiler/google/protobuf/descriptor.pb.h +++ b/plugin/compiler/google/protobuf/descriptor.pb.h @@ -3319,12 +3319,53 @@ class FileOptions : public ::google::protobuf::Message /* @@protoc_insertion_poi void unsafe_arena_set_allocated_php_namespace( ::std::string* php_namespace); - // optional bool cc_enable_arenas = 31 [default = false]; - bool has_cc_enable_arenas() const; - void clear_cc_enable_arenas(); - static const int kCcEnableArenasFieldNumber = 31; - bool cc_enable_arenas() const; - void set_cc_enable_arenas(bool value); + // optional string php_metadata_namespace = 44; + bool has_php_metadata_namespace() const; + void clear_php_metadata_namespace(); + static const int kPhpMetadataNamespaceFieldNumber = 44; + const ::std::string& php_metadata_namespace() const; + void set_php_metadata_namespace(const ::std::string& value); + #if LANG_CXX11 + void set_php_metadata_namespace(::std::string&& value); + #endif + void set_php_metadata_namespace(const char* value); + void set_php_metadata_namespace(const char* value, size_t size); + ::std::string* mutable_php_metadata_namespace(); + ::std::string* release_php_metadata_namespace(); + void set_allocated_php_metadata_namespace(::std::string* php_metadata_namespace); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_php_metadata_namespace(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_php_metadata_namespace( + ::std::string* php_metadata_namespace); + + // optional string ruby_package = 45; + bool has_ruby_package() const; + void clear_ruby_package(); + static const int kRubyPackageFieldNumber = 45; + const ::std::string& ruby_package() const; + void set_ruby_package(const ::std::string& value); + #if LANG_CXX11 + void set_ruby_package(::std::string&& value); + #endif + void set_ruby_package(const char* value); + void set_ruby_package(const char* value, size_t size); + ::std::string* mutable_ruby_package(); + ::std::string* release_ruby_package(); + void set_allocated_ruby_package(::std::string* ruby_package); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_ruby_package(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_ruby_package( + ::std::string* ruby_package); // optional bool java_multiple_files = 10 [default = false]; bool has_java_multiple_files() const; @@ -3382,6 +3423,13 @@ class FileOptions : public ::google::protobuf::Message /* @@protoc_insertion_poi bool deprecated() const; void set_deprecated(bool value); + // optional bool cc_enable_arenas = 31 [default = false]; + bool has_cc_enable_arenas() const; + void clear_cc_enable_arenas(); + static const int kCcEnableArenasFieldNumber = 31; + bool cc_enable_arenas() const; + void set_cc_enable_arenas(bool value); + // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; bool has_optimize_for() const; void clear_optimize_for(); @@ -3428,6 +3476,10 @@ class FileOptions : public ::google::protobuf::Message /* @@protoc_insertion_poi void clear_has_php_class_prefix(); void set_has_php_namespace(); void clear_has_php_namespace(); + void set_has_php_metadata_namespace(); + void clear_has_php_metadata_namespace(); + void set_has_ruby_package(); + void clear_has_ruby_package(); ::google::protobuf::internal::ExtensionSet _extensions_; @@ -3446,7 +3498,8 @@ class FileOptions : public ::google::protobuf::Message /* @@protoc_insertion_poi ::google::protobuf::internal::ArenaStringPtr swift_prefix_; ::google::protobuf::internal::ArenaStringPtr php_class_prefix_; ::google::protobuf::internal::ArenaStringPtr php_namespace_; - bool cc_enable_arenas_; + ::google::protobuf::internal::ArenaStringPtr php_metadata_namespace_; + ::google::protobuf::internal::ArenaStringPtr ruby_package_; bool java_multiple_files_; bool java_generate_equals_and_hash_; bool java_string_check_utf8_; @@ -3455,6 +3508,7 @@ class FileOptions : public ::google::protobuf::Message /* @@protoc_insertion_poi bool py_generic_services_; bool php_generic_services_; bool deprecated_; + bool cc_enable_arenas_; int optimize_for_; friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileOptionsImpl(); @@ -8978,13 +9032,13 @@ inline void FileOptions::unsafe_arena_set_allocated_java_outer_classname( // optional bool java_multiple_files = 10 [default = false]; inline bool FileOptions::has_java_multiple_files() const { - return (_has_bits_[0] & 0x00000200u) != 0; + return (_has_bits_[0] & 0x00000400u) != 0; } inline void FileOptions::set_has_java_multiple_files() { - _has_bits_[0] |= 0x00000200u; + _has_bits_[0] |= 0x00000400u; } inline void FileOptions::clear_has_java_multiple_files() { - _has_bits_[0] &= ~0x00000200u; + _has_bits_[0] &= ~0x00000400u; } inline void FileOptions::clear_java_multiple_files() { java_multiple_files_ = false; @@ -9002,13 +9056,13 @@ inline void FileOptions::set_java_multiple_files(bool value) { // optional bool java_generate_equals_and_hash = 20 [deprecated = true]; inline bool FileOptions::has_java_generate_equals_and_hash() const { - return (_has_bits_[0] & 0x00000400u) != 0; + return (_has_bits_[0] & 0x00000800u) != 0; } inline void FileOptions::set_has_java_generate_equals_and_hash() { - _has_bits_[0] |= 0x00000400u; + _has_bits_[0] |= 0x00000800u; } inline void FileOptions::clear_has_java_generate_equals_and_hash() { - _has_bits_[0] &= ~0x00000400u; + _has_bits_[0] &= ~0x00000800u; } inline void FileOptions::clear_java_generate_equals_and_hash() { java_generate_equals_and_hash_ = false; @@ -9026,13 +9080,13 @@ inline void FileOptions::set_java_generate_equals_and_hash(bool value) { // optional bool java_string_check_utf8 = 27 [default = false]; inline bool FileOptions::has_java_string_check_utf8() const { - return (_has_bits_[0] & 0x00000800u) != 0; + return (_has_bits_[0] & 0x00001000u) != 0; } inline void FileOptions::set_has_java_string_check_utf8() { - _has_bits_[0] |= 0x00000800u; + _has_bits_[0] |= 0x00001000u; } inline void FileOptions::clear_has_java_string_check_utf8() { - _has_bits_[0] &= ~0x00000800u; + _has_bits_[0] &= ~0x00001000u; } inline void FileOptions::clear_java_string_check_utf8() { java_string_check_utf8_ = false; @@ -9050,13 +9104,13 @@ inline void FileOptions::set_java_string_check_utf8(bool value) { // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; inline bool FileOptions::has_optimize_for() const { - return (_has_bits_[0] & 0x00020000u) != 0; + return (_has_bits_[0] & 0x00080000u) != 0; } inline void FileOptions::set_has_optimize_for() { - _has_bits_[0] |= 0x00020000u; + _has_bits_[0] |= 0x00080000u; } inline void FileOptions::clear_has_optimize_for() { - _has_bits_[0] &= ~0x00020000u; + _has_bits_[0] &= ~0x00080000u; } inline void FileOptions::clear_optimize_for() { optimize_for_ = 1; @@ -9160,13 +9214,13 @@ inline void FileOptions::unsafe_arena_set_allocated_go_package( // optional bool cc_generic_services = 16 [default = false]; inline bool FileOptions::has_cc_generic_services() const { - return (_has_bits_[0] & 0x00001000u) != 0; + return (_has_bits_[0] & 0x00002000u) != 0; } inline void FileOptions::set_has_cc_generic_services() { - _has_bits_[0] |= 0x00001000u; + _has_bits_[0] |= 0x00002000u; } inline void FileOptions::clear_has_cc_generic_services() { - _has_bits_[0] &= ~0x00001000u; + _has_bits_[0] &= ~0x00002000u; } inline void FileOptions::clear_cc_generic_services() { cc_generic_services_ = false; @@ -9184,13 +9238,13 @@ inline void FileOptions::set_cc_generic_services(bool value) { // optional bool java_generic_services = 17 [default = false]; inline bool FileOptions::has_java_generic_services() const { - return (_has_bits_[0] & 0x00002000u) != 0; + return (_has_bits_[0] & 0x00004000u) != 0; } inline void FileOptions::set_has_java_generic_services() { - _has_bits_[0] |= 0x00002000u; + _has_bits_[0] |= 0x00004000u; } inline void FileOptions::clear_has_java_generic_services() { - _has_bits_[0] &= ~0x00002000u; + _has_bits_[0] &= ~0x00004000u; } inline void FileOptions::clear_java_generic_services() { java_generic_services_ = false; @@ -9208,13 +9262,13 @@ inline void FileOptions::set_java_generic_services(bool value) { // optional bool py_generic_services = 18 [default = false]; inline bool FileOptions::has_py_generic_services() const { - return (_has_bits_[0] & 0x00004000u) != 0; + return (_has_bits_[0] & 0x00008000u) != 0; } inline void FileOptions::set_has_py_generic_services() { - _has_bits_[0] |= 0x00004000u; + _has_bits_[0] |= 0x00008000u; } inline void FileOptions::clear_has_py_generic_services() { - _has_bits_[0] &= ~0x00004000u; + _has_bits_[0] &= ~0x00008000u; } inline void FileOptions::clear_py_generic_services() { py_generic_services_ = false; @@ -9232,13 +9286,13 @@ inline void FileOptions::set_py_generic_services(bool value) { // optional bool php_generic_services = 42 [default = false]; inline bool FileOptions::has_php_generic_services() const { - return (_has_bits_[0] & 0x00008000u) != 0; + return (_has_bits_[0] & 0x00010000u) != 0; } inline void FileOptions::set_has_php_generic_services() { - _has_bits_[0] |= 0x00008000u; + _has_bits_[0] |= 0x00010000u; } inline void FileOptions::clear_has_php_generic_services() { - _has_bits_[0] &= ~0x00008000u; + _has_bits_[0] &= ~0x00010000u; } inline void FileOptions::clear_php_generic_services() { php_generic_services_ = false; @@ -9256,13 +9310,13 @@ inline void FileOptions::set_php_generic_services(bool value) { // optional bool deprecated = 23 [default = false]; inline bool FileOptions::has_deprecated() const { - return (_has_bits_[0] & 0x00010000u) != 0; + return (_has_bits_[0] & 0x00020000u) != 0; } inline void FileOptions::set_has_deprecated() { - _has_bits_[0] |= 0x00010000u; + _has_bits_[0] |= 0x00020000u; } inline void FileOptions::clear_has_deprecated() { - _has_bits_[0] &= ~0x00010000u; + _has_bits_[0] &= ~0x00020000u; } inline void FileOptions::clear_deprecated() { deprecated_ = false; @@ -9280,13 +9334,13 @@ inline void FileOptions::set_deprecated(bool value) { // optional bool cc_enable_arenas = 31 [default = false]; inline bool FileOptions::has_cc_enable_arenas() const { - return (_has_bits_[0] & 0x00000100u) != 0; + return (_has_bits_[0] & 0x00040000u) != 0; } inline void FileOptions::set_has_cc_enable_arenas() { - _has_bits_[0] |= 0x00000100u; + _has_bits_[0] |= 0x00040000u; } inline void FileOptions::clear_has_cc_enable_arenas() { - _has_bits_[0] &= ~0x00000100u; + _has_bits_[0] &= ~0x00040000u; } inline void FileOptions::clear_cc_enable_arenas() { cc_enable_arenas_ = false; @@ -9727,6 +9781,176 @@ inline void FileOptions::unsafe_arena_set_allocated_php_namespace( // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.php_namespace) } +// optional string php_metadata_namespace = 44; +inline bool FileOptions::has_php_metadata_namespace() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void FileOptions::set_has_php_metadata_namespace() { + _has_bits_[0] |= 0x00000100u; +} +inline void FileOptions::clear_has_php_metadata_namespace() { + _has_bits_[0] &= ~0x00000100u; +} +inline void FileOptions::clear_php_metadata_namespace() { + php_metadata_namespace_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + clear_has_php_metadata_namespace(); +} +inline const ::std::string& FileOptions::php_metadata_namespace() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_metadata_namespace) + return php_metadata_namespace_.Get(); +} +inline void FileOptions::set_php_metadata_namespace(const ::std::string& value) { + set_has_php_metadata_namespace(); + php_metadata_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_metadata_namespace) +} +#if LANG_CXX11 +inline void FileOptions::set_php_metadata_namespace(::std::string&& value) { + set_has_php_metadata_namespace(); + php_metadata_namespace_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.php_metadata_namespace) +} +#endif +inline void FileOptions::set_php_metadata_namespace(const char* value) { + GOOGLE_DCHECK(value != NULL); + set_has_php_metadata_namespace(); + php_metadata_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.php_metadata_namespace) +} +inline void FileOptions::set_php_metadata_namespace(const char* value, + size_t size) { + set_has_php_metadata_namespace(); + php_metadata_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.php_metadata_namespace) +} +inline ::std::string* FileOptions::mutable_php_metadata_namespace() { + set_has_php_metadata_namespace(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.php_metadata_namespace) + return php_metadata_namespace_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FileOptions::release_php_metadata_namespace() { + // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_metadata_namespace) + clear_has_php_metadata_namespace(); + return php_metadata_namespace_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void FileOptions::set_allocated_php_metadata_namespace(::std::string* php_metadata_namespace) { + if (php_metadata_namespace != NULL) { + set_has_php_metadata_namespace(); + } else { + clear_has_php_metadata_namespace(); + } + php_metadata_namespace_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), php_metadata_namespace, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_metadata_namespace) +} +inline ::std::string* FileOptions::unsafe_arena_release_php_metadata_namespace() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.php_metadata_namespace) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_php_metadata_namespace(); + return php_metadata_namespace_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void FileOptions::unsafe_arena_set_allocated_php_metadata_namespace( + ::std::string* php_metadata_namespace) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (php_metadata_namespace != NULL) { + set_has_php_metadata_namespace(); + } else { + clear_has_php_metadata_namespace(); + } + php_metadata_namespace_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + php_metadata_namespace, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.php_metadata_namespace) +} + +// optional string ruby_package = 45; +inline bool FileOptions::has_ruby_package() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void FileOptions::set_has_ruby_package() { + _has_bits_[0] |= 0x00000200u; +} +inline void FileOptions::clear_has_ruby_package() { + _has_bits_[0] &= ~0x00000200u; +} +inline void FileOptions::clear_ruby_package() { + ruby_package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + clear_has_ruby_package(); +} +inline const ::std::string& FileOptions::ruby_package() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.ruby_package) + return ruby_package_.Get(); +} +inline void FileOptions::set_ruby_package(const ::std::string& value) { + set_has_ruby_package(); + ruby_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.ruby_package) +} +#if LANG_CXX11 +inline void FileOptions::set_ruby_package(::std::string&& value) { + set_has_ruby_package(); + ruby_package_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.ruby_package) +} +#endif +inline void FileOptions::set_ruby_package(const char* value) { + GOOGLE_DCHECK(value != NULL); + set_has_ruby_package(); + ruby_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.ruby_package) +} +inline void FileOptions::set_ruby_package(const char* value, + size_t size) { + set_has_ruby_package(); + ruby_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.ruby_package) +} +inline ::std::string* FileOptions::mutable_ruby_package() { + set_has_ruby_package(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.ruby_package) + return ruby_package_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FileOptions::release_ruby_package() { + // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.ruby_package) + clear_has_ruby_package(); + return ruby_package_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void FileOptions::set_allocated_ruby_package(::std::string* ruby_package) { + if (ruby_package != NULL) { + set_has_ruby_package(); + } else { + clear_has_ruby_package(); + } + ruby_package_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ruby_package, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.ruby_package) +} +inline ::std::string* FileOptions::unsafe_arena_release_ruby_package() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.ruby_package) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_ruby_package(); + return ruby_package_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void FileOptions::unsafe_arena_set_allocated_ruby_package( + ::std::string* ruby_package) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (ruby_package != NULL) { + set_has_ruby_package(); + } else { + clear_has_ruby_package(); + } + ruby_package_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ruby_package, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.ruby_package) +} + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int FileOptions::uninterpreted_option_size() const { return uninterpreted_option_.size(); diff --git a/plugin/compiler/swift_message.cc b/plugin/compiler/swift_message.cc index e5abce4..aa7cbdc 100644 --- a/plugin/compiler/swift_message.cc +++ b/plugin/compiler/swift_message.cc @@ -469,8 +469,8 @@ namespace google { namespace protobuf { namespace compiler { namespace swift { " return try $classNameReturnedType$.Builder.decodeToBuilder(jsonMap:jsonMap).build()\n" "}\n"); - printer->Print(variables_,"override class $acontrol$ func fromJSON(data:Data) throws -> $classNameReturnedType$ {\n" - " return try $classNameReturnedType$.Builder.fromJSONToBuilder(data:data).build()\n" + printer->Print(variables_,"override class $acontrol$ func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> $classNameReturnedType$ {\n" + " return try $classNameReturnedType$.Builder.fromJSONToBuilder(data:data, options:options).build()\n" "}\n"); } @@ -492,8 +492,8 @@ namespace google { namespace protobuf { namespace compiler { namespace swift { "}\n"); printer->Print(variables_, - "override class $acontrol$ func fromJSONToBuilder(data:Data) throws -> $classNameReturnedType$.Builder {\n" - " let jsonData = try JSONSerialization.jsonObject(with:data)\n" + "override class $acontrol$ func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> $classNameReturnedType$.Builder {\n" + " let jsonData = try JSONSerialization.jsonObject(with:data, options: options)\n" " guard let jsDataCast = jsonData as? Dictionary else {\n" " throw ProtocolBuffersError.invalidProtocolBuffer(\"Invalid JSON data\")\n" " }\n"