-
Notifications
You must be signed in to change notification settings - Fork 6
[iOS] Add a local schema to building of “answers.json” #231
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
case .array(let value): | ||
return (value.map { "\($0)" }.joined(separator: ","), .string) | ||
default: | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems problematic to return nil for types not supported by the flatAnswer() function. Previously if we had a value it would get serialized into the answers file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added "object" (though we don't actually have any currently supported question types that use this answer type).
Currently we do not have any examples but technically its allowed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
It's pretty straight-forward to add the schema to the "answers.json" file on iOS. This was already supported as a part of Sage Research and we deprecated it b/c we were going away from data parsing and the researchers wanted timestamps and question text, etc. That model doesn't lend itself well to the flattened table. ¯_(ツ)_/¯