You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[NFC] Inject asSwiftSafeName as a dependency (apple#148)
[NFC] Inject asSwiftSafeName as a dependency
### Motivation
Arguably, we should have done this before, but here we go. In order to allow dynamically customizing the logic for converting OpenAPI to Swift identifiers (in support of staging SOAR-0001 gradually), we need to dependency-inject the `(String) -> String` function to all the places that need to do this conversion.
### Modifications
This PR doesn't change any behavior (NFC - no functional change), it just refactors the code to have a single funnel point through which all the conversion goes, which has access to the `Config` and can inspect feature flags.
Right now, the default behavior is still the same, but this PR creates room for adding the alternative logic from SOAR-0001.
### Result
NFC, prepares room for a subsequent PR.
Now it's possible to conditionalize the Swift name computing logic based on feature flags.
### Test Plan
All tests are passing, adapted as needed, created conveniences in tests for getting a default `Config`, but also made it possible to test the logic by explicitly passing the feature flag.
Reviewed by: simonjbeaumont
Builds:
✔︎ pull request validation (5.8) - Build finished.
✔︎ pull request validation (5.9) - Build finished.
✔︎ pull request validation (docc test) - Build finished.
✔︎ pull request validation (integration test) - Build finished.
✔︎ pull request validation (nightly) - Build finished.
✔︎ pull request validation (soundness) - Build finished.
apple#148
0 commit comments