Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace AttributeOptions with more extensible type #718

Open
1ec5 opened this issue Jul 19, 2022 · 1 comment
Open

Replace AttributeOptions with more extensible type #718

1ec5 opened this issue Jul 19, 2022 · 1 comment
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

Comments

@1ec5
Copy link
Contributor

1ec5 commented Jul 19, 2022

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.

@1ec5 1ec5 added backwards incompatible changes that break backwards compatibility of public API op-ex Refactoring, Tech Debt or any other operational excellence work. labels Jul 19, 2022
@1ec5 1ec5 added this to the v3.0 milestone Jul 19, 2022
@1ec5 1ec5 linked a pull request Sep 22, 2022 that will close this issue
@1ec5 1ec5 removed a link to a pull request Sep 22, 2022
@1ec5
Copy link
Contributor Author

1ec5 commented Sep 22, 2022

As a workaround until the next major version, #748 adds an extensibility hook to AttributeOptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

2 participants