Comments (3)
@s4cha how about making the deserialize
func throwing?
from arrow.
@maxkonovalov , good question :)
Arrow didn't have error handling (on purpose) but this is something we can discuss. Having given this some time I think it might not be worth it. I personally never had the need to test errors in JSON parsing as I believe that this is an Api-side problem.
On the iOS side, Unit tests test against local JSON files to make sure parsing works as expected.
On the backed side, unit tests test that the api sends the correct JSON structures.
Could you elaborate on a concrete case where we need to catch parsing errors?
from arrow.
@s4cha agreed, I don't have such use cases either. For me it works perfect just to do nothing if the key is not there or could not be parsed. Other frameworks usually provide a way to specify a fallback value for that case.
from arrow.
Related Issues (19)
- Doesn't compile with snapshot 4-12 HOT 5
- Value of type 'JSON' has no member 'collection' HOT 2
- Array of enums HOT 5
- Is the swift 3 branch stable? HOT 6
- No inheritance on Structs HOT 2
- Release 3.0.3 not available on master HOT 1
- <== not working for me HOT 6
- Does this library allow to serialize a JSON string to an object? HOT 4
- please make dateFormatter in Arrow.swift public HOT 4
- Swift 4 HOT 3
- Codable HOT 3
- Cannot cast json to other type HOT 3
- Support optional data for custom models
- How do I instantiate a model directly from a string containing json? HOT 4
- How do you use Arrow with Moya+RxSwift HOT 5
- netsted values problem
- Doesn't compile on Linux OS HOT 1
- Privacy Manifest HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arrow.