Arbitrarily bump version to 1.0.0. API is stable and it doesn't make sense to have it in production and still be on the 0.X
versioning scheme.
- Upgrade to Swift 4.2
- Upgrade to Alamofire 4.7
- Upgrade to SwiftyJSON 4.2
- Upgrade to RealmSwift 3.13
- Upgrade to Swift 4.0
- Upgrade to RealmSwift 3.0.1
- Upgrade to Alamofire 4.5
- Don't log headers by default since it might contain sensitive information
Breaking changes:
- Change Rails-style callback methods to include the response
ApiModelResponse
instance in the callback parameters. This affects:- Api.find
- Api.findArray
- Api.update
- Api.create
This makes it possible to get the error messages from the request, but also lets the caller know more about the request.
For example, with the new parameters:
Api<Post>.find { post, response in
if let post = post {
print("Got post \(post.title)")
} else if let errors = response.errorMessages {
print("got errors: \(errors.join("\n"))")
}
}
Api<Post>.find { post in
if let post = post {
print("Got post \(post.title)")
} else {
print("error?")
}
}
Breaking changes:
- Update to Realm 1.0.0 🎈🎈🎈
Breaking changes:
- Changed the interface for
Transform
. Theperform
-method now includes a second parameter:
func perform(value: AnyObject?, realm: Realm?) -> AnyObject?
This will be the Realm object that will be associated with any newly created objects. For example in ModelTransform
or ArrayTransform
.
Dependency upgrade:
- This release bumps Realm to version
0.98.4
, which should not break your app installs.
- Fixes #22. Code for
rootNamespace
had been broken since a bad rebase. Included tests to verify fix.
- Update to
RealmSwift 0.96.3
Breaking changes:
- Rename
API
toApiManager
- Rename
api()
toapiManager()
- Rename
ApiForm
toApi
- Rename
ApiFormResponse
toApiModelResponse
- Rename
ApiConfiguration
toApiConfig
- Upgrade
RealmSwift
to0.96
which might be breaking for your app. Please read the Realm blog post for more details - Upgrade
Alamofire
to3.0.0
which might require upgrades of your app.
(This version was never released to cocoapods.org)
- Implement file uploads. Please se
README.md
for more details.
- Fix crash caused by SwiftyJSON when running on device
- Fix for when server responds with an unparseable response and with a non-200 status code
- When checking for array responses also check if root is an array
- Introduce
ApiConfiguration.rootNamespace
for namespaced responses
Behind the scenes:
- Write initial tests for root namespace related methods
- Upgrade RealmSwift to 0.94.0
- Add
encoding
toApiConfiguration
and make.URL
default encoding
- Add
responseData
andrawResponse
toApiFormResponse
- Introduce concept of parameter encoding (URL encoding, JSON encoding, etc)
- Upgrade Alamofire to 1.3
Fixed:
- Treat nil values as false in
BoolTransform
Fixed:
- If a request path contains a full URL do not prefix with configurated host
- Also recognize error responses when error messages are an array
Breaking changes:
- Rename ApiResource to ApiRoutes
- Rename entire project to ApiModel instead of APIModel
- Remove legacy ApiForm.load method in favor of ApiForm.find
- Rename ApiForm.post to ApiForm.create, and create a corresponding ApiForm.update
Fixed:
- Create concept of response parsers, with JSONParser as default parser.
- Add basic request logging that is enabled by default
- Create ApiForm.get/post/put/delete methods for more intuitive REST calling
- Add a destroy method on ApiForm with parameters
- Refactor ApiForm internally for more code reuse
- Making it possible to set the path and namespace for .findArray
- Create an ApiFormResponse that is returned by most methods of ApiForm. It contains the parsed objects and other metadata about the request and response
- Correctly deal with pluralized namespaces on save
- Change
ToArray(realmArray: myArray).get()
totoArray(myArray)
- Upgrade to
Realm 0.92
, meaning usingimport RealmSwift
- Create
.xcodeproj
to compile standalone.framework
- Add method to retrieve an API url for an object.
Object#apiUrlForResource
- Fix a crash when
primaryKey
wasn't implemented
- More stuff
- Got it working