Skip to content

Commit

Permalink
use camelCaseObjectMapper in DocsController
Browse files Browse the repository at this point in the history
  • Loading branch information
ndy2 committed Dec 19, 2024
1 parent 77d7d47 commit 8ef7933
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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}
Expand All @@ -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))
Expand Down

0 comments on commit 8ef7933

Please sign in to comment.