In my opinion, dataType should be optional in order to allow a response without a Content-Type for an empty body. This would also allow us to use Content-Type in additionalHeaders, as Content-Type is currently always overwritten by dataType.headerValue, which might be useful if you do not to spread your headers over two parameters.
An alternative would be to provide a DataType
public static let none = Mock.DataType(name: "none", headerValue: "")
and to ensure, that Content-Type is written to header only if dataType.headerValue is not empty.
Which approach do you prefer? I'm open to file a PR if you wish me to do so.
@chkpnt this makes total sense to me (e.g. 202 responses). Making DataType optional makes most sense to me, since none is not a data type strictly said.
In my opinion,
dataType
should be optional in order to allow a response without aContent-Type
for an empty body. This would also allow us to useContent-Type
inadditionalHeaders
, asContent-Type
is currently always overwritten bydataType.headerValue
, which might be useful if you do not to spread your headers over two parameters.An alternative would be to provide a
DataType
and to ensure, that
Content-Type
is written to header only ifdataType.headerValue
is not empty.Which approach do you prefer? I'm open to file a PR if you wish me to do so.