mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-26 18:28:27 +02:00
Fix google protobuf WellKnownTypes: Empty, Duration and Timestamp (#1231)
* Fix google protobuf WellKnownTypes: Timestamp and Duration * Fix protobuf Empty * . * small refactor * 006 * fix * policy * --- * <PackageReference Include="ProtoBufJsonConverter" Version="0.7.0" />
This commit is contained in:
@@ -242,7 +242,7 @@ public partial class Response
|
||||
Guard.NotNull(value);
|
||||
|
||||
#if !PROTOBUF
|
||||
throw new System.NotSupportedException("The WithBodyAsProtoBuf method can not be used for .NETStandard1.3 or .NET Framework 4.6.1 or lower.");
|
||||
throw new NotSupportedException("The WithBodyAsProtoBuf method can not be used for .NETStandard1.3 or .NET Framework 4.6.1 or lower.");
|
||||
#else
|
||||
ResponseMessage.BodyDestination = null;
|
||||
ResponseMessage.BodyData = new BodyData
|
||||
@@ -252,8 +252,9 @@ public partial class Response
|
||||
ProtoDefinition = () => new IdOrTexts(null, protoDefinitions),
|
||||
ProtoBufMessageType = messageType
|
||||
};
|
||||
#endif
|
||||
|
||||
return this;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -268,7 +269,7 @@ public partial class Response
|
||||
Guard.NotNull(value);
|
||||
|
||||
#if !PROTOBUF
|
||||
throw new System.NotSupportedException("The WithBodyAsProtoBuf method can not be used for .NETStandard1.3 or .NET Framework 4.6.1 or lower.");
|
||||
throw new NotSupportedException("The WithBodyAsProtoBuf method can not be used for .NETStandard1.3 or .NET Framework 4.6.1 or lower.");
|
||||
#else
|
||||
ResponseMessage.BodyDestination = null;
|
||||
ResponseMessage.BodyData = new BodyData
|
||||
@@ -278,7 +279,8 @@ public partial class Response
|
||||
ProtoDefinition = () => Mapping.ProtoDefinition ?? throw new WireMockException("ProtoDefinition cannot be resolved. You probably forgot to call .WithProtoDefinition(...) on the mapping."),
|
||||
ProtoBufMessageType = messageType
|
||||
};
|
||||
#endif
|
||||
|
||||
return this;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user