MantleFramework/Mantle — pull request #264 by paulyoung (2014-03-08 05:45:54+00:00)
Title: Ability to specify a subset of properties for JSON representation.

This pull request allows people to specify which properties are included in the JSON representation of their models on a per _class_ basis.

This is different from mapping a property to `NSNull.null` since it still allows the values of JSON key paths to be represented in model properties, but not the other way around.

It does not currently provide the ability to specify which keys should be included on a per _serialization_ basis (the use case being a HTTP PATCH request), but these changes could possibly be leveraged in providing support for that.

As discussed with @robb in #185 - I have a similar implementation which was achieved by extending `MTLJSONSerializing` and `MTLJSONAdapter`, and thought others might benefit from it being part of Mantle proper.

My use case was that I wanted to create a JSON representation of a newly created model so that I could send it in a POST request. Certain keys are managed by the server and therefore shouldn't have been present in a request. They were however expected to be present in a response, then their values assigned to properties of a model.