From 8ef7933130c63f1d85a5b9b4af3a6905345d3e9e Mon Sep 17 00:00:00 2001 From: deukyun Date: Fri, 20 Dec 2024 07:47:20 +0900 Subject: [PATCH] use camelCaseObjectMapper in DocsController --- .../com/jakehschwartz/finatra/swagger/DocsController.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/scala/com/jakehschwartz/finatra/swagger/DocsController.scala b/src/main/scala/com/jakehschwartz/finatra/swagger/DocsController.scala index f71162d..88f0771 100644 --- a/src/main/scala/com/jakehschwartz/finatra/swagger/DocsController.scala +++ b/src/main/scala/com/jakehschwartz/finatra/swagger/DocsController.scala @@ -1,5 +1,7 @@ package com.jakehschwartz.finatra.swagger +import com.fasterxml.jackson.datatype.joda.JodaModule + import java.io.BufferedInputStream import java.util.Date import com.twitter.finagle.http.{Message, Request} @@ -17,10 +19,13 @@ import scala.util.{Failure, Success, Try} @Singleton class DocsController @Inject()(openAPI: OpenAPI, - objectMapper: ScalaObjectMapper, @Flag("swagger.docs.endpoint") endpoint: String) extends Controller { + private val objectMapper = ScalaObjectMapper.builder + .camelCaseObjectMapper + .registerModule(new JodaModule()) + get("/swagger.json") { _: Request => response .ok(objectMapper.writeValueAsString(openAPI))