All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.fintrospect.renderers.ModuleRenderer.scala Maven / Gradle / Ivy

There is a newer version: 12.21.1
Show newest version
package io.fintrospect.renderers

import com.twitter.finagle.http.Status.NotFound
import com.twitter.finagle.http.path.Path
import com.twitter.finagle.http.{Request, Response}
import io.fintrospect.ServerRoute
import io.fintrospect.parameters.{InvalidParameter, Security}

/**
 * This is used to render the various standard responses (bad request/the description route).
 * Provide one of these to implement a pluggable custom format for module responses.
 */
trait ModuleRenderer {
  def notFound(request: Request): Response = Response(NotFound)

  def badRequest(badParameters: Seq[InvalidParameter]): Response

  def description(basePath: Path, security: Security, routes: Seq[ServerRoute[_, _]]): Response
}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy