Refactor ApiRegistrar class away#1023
Merged
gerlowskija merged 2 commits intoapache:mainfrom Sep 19, 2022
Merged
Conversation
Earlier on during v2 API refactoring, I had created ApiRegistrar as a way to bundle together the registration of API classes that were multiplying and cluttering up CoreContainer.load. In hindsight, this was based on a misunderstanding that there was a reason to register APIs (directly) in CoreContainer.load in the first place. But there's not: both core and container-level APIs can be registered just fine via the 'getApis()' method present on their associated requestHandler. The only APIs that cannot use this approach, and must be registered explicitly in CoreContainer.load are those v2 APIs that don't have a v1/requestHandler equivalent. With this in mind, I'm removing my ill-conceived attempt at an ApiRegistrar class, to simplify the overall picture for API registration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Earlier on during v2 API refactoring, I had created ApiRegistrar as a way to bundle together the registration of API classes that were multiplying and cluttering up CoreContainer.load.
In hindsight, this was based on a misunderstanding that there was a reason to register APIs (directly) in CoreContainer.load in the first place. But there's not: both core and container-level APIs can be registered just fine via the 'getApis()' method present on their associated requestHandler. The only APIs that cannot use this approach, and must be registered explicitly in CoreContainer.load are those v2 APIs that don't have a v1/requestHandler equivalent.
Solution
With this in mind, I'm removing my ill-conceived attempt at an ApiRegistrar class, to simplify the overall picture for API registration.
Tests
N/A - change is a refactor only, so existing tests must continue to pass.
Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.