Skip to content

Commit

Permalink
Fix core XcontentFactory refactor (#732)
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <ihailong@amazon.com>
  • Loading branch information
Hailong-am committed Jul 31, 2023
1 parent 58a7578 commit 216dfcb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import org.apache.hc.core5.http.HttpResponse
import org.apache.hc.core5.http.io.entity.EntityUtils
import org.apache.hc.core5.http.io.entity.StringEntity
import org.apache.hc.core5.util.Timeout
import org.opensearch.common.xcontent.XContentFactory
import org.opensearch.common.xcontent.XContentType
import org.opensearch.core.rest.RestStatus
import org.opensearch.core.xcontent.MediaTypeRegistry
import org.opensearch.notifications.core.setting.PluginSettings
import org.opensearch.notifications.core.utils.OpenForTesting
import org.opensearch.notifications.core.utils.logger
Expand Down Expand Up @@ -155,7 +155,7 @@ class DestinationHttpClient {
}

fun buildRequestBody(destination: WebhookDestination, message: MessageContent): String {
val builder = XContentFactory.contentBuilder(XContentType.JSON)
val builder = MediaTypeRegistry.contentBuilder(XContentType.JSON)
val keyName = when (destination) {
// Slack webhook request body has required "text" as key name https://api.slack.com/messaging/webhooks
// Chime webhook request body has required "Content" as key name
Expand Down

0 comments on commit 216dfcb

Please sign in to comment.