-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Base#[] could coerce children's types, based on format keyword or other indications of a more natural representation. e.g.:
format: date-timecoerces to a rubyTimeformat: uuidcoerces to UUIDTools::UUID- application will have to install/Gemfile external dependencies
type: array+uniqueItems: truecoerces toSet?- weird one. if the Set contains JSIs (ArrayNode#to_ary), they will never be equal, so never uniq'd (being at different pointers - unless I do end up changing
Base#==/#hashto disregard pointer). I could skip adding nodes whose content is already in the Set, but that sounds bad. Setis not appropriate ifitemsis an array (orprefixItems/postfixItemsused, later)- Set is, in practice, ordered, but not in theory.
- if I do any uniquifying, indices will not match anyway
- probably not a worthwhile idea, all around.
- weird one. if the Set contains JSIs (ArrayNode#to_ary), they will never be equal, so never uniq'd (being at different pointers - unless I do end up changing
more thoughts:
Base#[]=must coerce opposite toBase#[]. instance data must stay as json types.- memoization or recalculation of coerced values? storing a coerced value from a setter? is coercion roundtrip-safe?
- lots in common here with ActiveRecord/other ORMs' coercions from database types to ruby
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels