-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Refactor] MediaTypeParser to MediaTypeParserRegistry #8636
[Refactor] MediaTypeParser to MediaTypeParserRegistry #8636
Conversation
Gradle Check (Jenkins) Run Completed with:
|
614b0ca
to
2b50552
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## main #8636 +/- ##
============================================
- Coverage 71.14% 70.96% -0.18%
+ Complexity 57214 57172 -42
============================================
Files 4757 4757
Lines 269804 269823 +19
Branches 39454 39474 +20
============================================
- Hits 191940 191471 -469
- Misses 61716 62266 +550
+ Partials 16148 16086 -62
|
2b50552
to
3d8724b
Compare
Signed-off-by: Nicholas Walter Knize <[email protected]>
Signed-off-by: Nicholas Walter Knize <[email protected]>
0516680
to
c7eacc4
Compare
Gradle Check (Jenkins) Run Completed with:
|
Will this be backported to 2.x ? |
When Lines 188 to 190 in 6786608
OpenSearch/libs/x-content/src/main/java/org/opensearch/common/xcontent/XContentFactory.java Lines 132 to 136 in 6786608
type.getClass() crashes on line 136 above ^, because type is null.
|
@nknize Whats the reason for removing default media type and introducing a new static function to set it up? |
Defaults are still there. The registry needs to be initialized. The static Singleton was refactored so the core is not tightly coupled to the XContentType enum. This way downstream plugins can dynamically register a custom media type. |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-8636-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 3f8e0cd3de219dee302788a3616ec33835055e5f
# Push it to GitHub
git push --set-upstream origin backport/backport-8636-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x Then, create a pull request where the |
…ject#8636) Refactors the static MediaTypeParser utility to a dynamic registry to support registration of new MediaType definitions. This is a next step to decoupling the x-content library from core classes in the server module to support modularity and cloud or serverless implementations. Signed-off-by: Nicholas Walter Knize <[email protected]>
…ject#8636) Refactors the static MediaTypeParser utility to a dynamic registry to support registration of new MediaType definitions. This is a next step to decoupling the x-content library from core classes in the server module to support modularity and cloud or serverless implementations. Signed-off-by: Nicholas Walter Knize <[email protected]> (cherry picked from commit 3f8e0cd)
Refactors the static MediaTypeParser utility to a dynamic registry to support registration of new MediaType definitions. This is a next step to decoupling the x-content library from core classes in the server module to support modularity and cloud or serverless implementations. Signed-off-by: Nicholas Walter Knize <[email protected]> (cherry picked from commit 3f8e0cd)
…ject#8636) Refactors the static MediaTypeParser utility to a dynamic registry to support registration of new MediaType definitions. This is a next step to decoupling the x-content library from core classes in the server module to support modularity and cloud or serverless implementations. Signed-off-by: Nicholas Walter Knize <[email protected]> Signed-off-by: Kaushal Kumar <[email protected]>
…ject#8636) Refactors the static MediaTypeParser utility to a dynamic registry to support registration of new MediaType definitions. This is a next step to decoupling the x-content library from core classes in the server module to support modularity and cloud or serverless implementations. Signed-off-by: Nicholas Walter Knize <[email protected]> Signed-off-by: Ivan Brusic <[email protected]>
…ject#8636) Refactors the static MediaTypeParser utility to a dynamic registry to support registration of new MediaType definitions. This is a next step to decoupling the x-content library from core classes in the server module to support modularity and cloud or serverless implementations. Signed-off-by: Nicholas Walter Knize <[email protected]> Signed-off-by: Shivansh Arora <[email protected]>
Refactors the static MediaTypeParser utility to a dynamic registry to support registration of new MediaType definitions. This is a next step to decoupling the x-content library from core classes in the server module to support modularity and cloud or serverless implementations.
relates #5910
relates #8110