wvteijlingen / Spine

A Swift library for working with JSON:API APIs. It supports mapping to custom model classes, fetching, advanced querying, linking and persisting.
MIT License
266 stars 109 forks source link

Making the URLValueFormatter more resilient #186

Open clacladev opened 7 years ago

clacladev commented 7 years ago

Making the URLValueFormatter more resilient. If the string value passed in the unformatValue is not one representing a valid url, now the URL init is not force unwrapped, so if it fails the code will not crash anymore. The scenario in with the URL creation fails is now managed. Example input that makes the URLValueFormatter crash is "http://example.com/page1\"" (with an escaped quote at the end).

I also fixed some Swift 3 conversion to string warnings.