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

Fully abstract XContentType to MediaType #8800

Open
nknize opened this issue Jul 20, 2023 · 0 comments
Open

Fully abstract XContentType to MediaType #8800

nknize opened this issue Jul 20, 2023 · 0 comments
Labels
enhancement Enhancement or improvement to existing feature or request Meta Meta issue, not directly linked to a PR

Comments

@nknize
Copy link
Collaborator

nknize commented Jul 20, 2023

Is your feature request related to a problem? Please describe.

I just realized we didn't have an explicit issue for this. XContentType is used to specify the string format for several different mechanisms (e.g., REST I/O, ClusterMetadata, any of the 1379 class that that implement toXContent). Today the core support four options (JSON, YAML, SMILE, CBOR) as defined in this class. These concrete implementations exist in the :libs:opensearch-xcontent library such that downstreams could (theoretically) implement their own XContent format. However, XContentType and JSON is hard coded in various places throughout the code base.

Describe the solution you'd like
As part of enabling REST API Versioning, I've started abstracting the core to MediaType such that XContentType only defines the concrete implementations provided by the core xcontent library, and MediaType provides the interfaces provided by the core library.

This meta issue is to see that refactor to completion to fully decouple plugins, modules, and :server from the core XContentType implementation by switching over to the MediaType base interface.

Describe alternatives you've considered
Leave it tightly coupled.

relates #5910
relates #8110

@nknize nknize added enhancement Enhancement or improvement to existing feature or request Meta Meta issue, not directly linked to a PR labels Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request Meta Meta issue, not directly linked to a PR
Projects
None yet
Development

No branches or pull requests

2 participants