Replace AttributeOptions with more extensible type #718
Labels
backwards incompatible
changes that break backwards compatibility of public API
jira-sync-complete
op-ex
Refactoring, Tech Debt or any other operational excellence work.
Milestone
AttributeOptions has historically been an OptionSet for convenience and to avoid redundancy: #118 (comment). However, after we made it an OptionSet, it became apparent that the Directions API could arbitrarily begin accepting or returning new unrecognized values.
OptionSet is essentially syntactic sugar and a more compact representation of Set composed with an enumeration. We should replace it with an explicit Set and an “extensible enumeration”. This could take the form of either a struct with constants or an enumeration with an
unrecognized(_:)
case (taking the raw string as an associated value). A less compact representation in memory won’t be a problem, because it’s unlikely that a request would ever specify more than a handful of attributes anyways.This would be a backwards-incompatible change.
The text was updated successfully, but these errors were encountered: