Fully abstract XContentType to MediaType #8800
Labels
enhancement
Enhancement or improvement to existing feature or request
Meta
Meta issue, not directly linked to a PR
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 thatXContentType
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 theMediaType
base interface.Describe alternatives you've considered
Leave it tightly coupled.
relates #5910
relates #8110
The text was updated successfully, but these errors were encountered: