Skip to content

Commit

Permalink
Add support for subtypes of application/json in http4s
Browse files Browse the repository at this point in the history
  • Loading branch information
erdebee committed Apr 13, 2021
1 parent 12d375b commit ce4b860
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ object Http4sHelper {

private def isJsonEncoderDecoder(consumesOrProduces: Seq[ContentType]): Boolean =
consumesOrProduces.contains(ApplicationJson) ||
consumesOrProduces.exists(ct => ct.value.startsWith("application/") && ct.value.endsWith("+json")) ||
consumesOrProduces.isEmpty ||
consumesOrProduces.contains(AnyContentType) //guardrial converts missing contentTypes to */* what should be converted to JSON according OpenAPI
}

0 comments on commit ce4b860

Please sign in to comment.