swift-server / swift-aws-lambda-runtime

Swift implementation of AWS Lambda Runtime
Apache License 2.0
1.13k stars 102 forks source link

JSONEncoder/JSONDecoder and String convenience methods #144

Closed fabianfett closed 4 years ago

fabianfett commented 4 years ago

Motivation:

Little common denominator after a long discussion in #129: JSONEncoder and JSONDecoder should have convenience methods to encode into String and decode from String.

Result:

ktoso commented 4 years ago

I somewhat fail to see how this specific extensions are addressing the wider goal that was discussed in the linked issue #129 @fabianfett ? Tomer's comment https://github.com/swift-server/swift-aws-lambda-runtime/pull/129#issuecomment-652613419 outlines a somewhat wider effort than just the string coding functions -- i.e. by adding functions to the gateway handler, rather than just to specific JSON coder types.

What am I missing here?

ktoso commented 4 years ago

Chatted some more; as I mentioned, not really strong opinion here so going to leave to @tomerd to decide if we're ok with these 👍

tomerd commented 4 years ago

my only concern here is with extending public types from the SDK from which may conflict with other libraries if they do the same - we typically try to avoid doing so

@weissi wdyt?

fabianfett commented 4 years ago

my only concern here is with extending public types from the SDK from which may conflict with other libraries if they do the same - we typically try to avoid doing so

I don't want to steer the discussion in one direction and I'm sure you're aware, but let me mention for completeness, that we also extend the JSONEncoder and JSONDecoder for ByteBuffer.