Add idea of using KeyPaths to specify includes on a JSONAPIDocument

This commit is contained in:
Mathew Polzin
2018-11-15 23:43:14 -08:00
parent 2ae92cf33f
commit 69faa1b33f
+2 -2
View File
@@ -59,7 +59,7 @@ The primary goals of this framework are:
- [ ] `links`
- [ ] `meta`
### EntityDescription Validator
### EntityDescription Validator (using reflection)
- [ ] Disallow optional array in `Attribute` and `Relationship` (should be empty array, not `null`).
- [ ] Only allow `Attribute` and `TransformAttribute` within `Attributes` struct.
- [ ] Only allow `ToManyRelationship` and `ToOneRelationship` within `Relationships` struct.
@@ -72,8 +72,8 @@ The primary goals of this framework are:
- [x] Support ability to distinguish between `Attributes` fields that are optional (i.e. the key might not be there) and `Attributes` values that are optional (i.e. the key is guaranteed to be there but it might be `null`).
- [x] Fix `ToOneRelationship` so that it is possible to specify an optional relationship where the value is `null` rather than the key being omitted.
- [ ] Conform to `CustomStringConvertible`
- [ ] Use `KeyPath` to specify `Includes` thus creating type safety around the relationship between a primary resource type and the types of included resources????
- [x] For `NoIncludes`, do not even loop over the "included" JSON API section if it exists.
- [ ] `EntityDescription` validator (using reflection)
- [ ] Property-based testing (using `SwiftCheck`)
- [ ] Roll my own `Result` or find an alternative that doesn't use `Foundation`.
- [ ] Create more descriptive errors that are easier to use for troubleshooting.