Skip to content

Commit

Permalink
Merge pull request #57 from hmrc/APIS-4417
Browse files Browse the repository at this point in the history
APIS-4417 Changed api definition to return 204 instead of 404
  • Loading branch information
adampridmore authored Jun 11, 2019
2 parents a24d872 + 0a9708b commit 700b918
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ class DocumentationController @Inject()(httpErrorHandler: HttpErrorHandler, appC
def definition = Action {
if(appContext.publishApiDefinition) {
Ok(txt.definition(appContext.apiContext, APIAccess.build(appContext.access))).withHeaders(CONTENT_TYPE -> JSON)
} else NotFound
} else NoContent
}

def raml(version: String, file: String) = Action {
if(appContext.publishApiDefinition) {
Ok(txt.application(appContext.apiContext))
} else NotFound
} else NoContent
}
}
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import uk.gov.hmrc.versioning.SbtGitVersioning
import scala.language.postfixOps

val compile = Seq(
"uk.gov.hmrc" %% "bootstrap-play-25" % "4.11.0",
"uk.gov.hmrc" %% "bootstrap-play-25" % "4.12.0",
"uk.gov.hmrc" %% "simple-reactivemongo" % "7.19.0-play-25"
)

Expand All @@ -35,8 +35,8 @@ val overrides = Seq(
)

def test(scope: String = "test,acceptance") = Seq(
"uk.gov.hmrc" %% "hmrctest" % "3.8.0-play-25" % scope,
"uk.gov.hmrc" %% "reactivemongo-test" % "4.13.0-play-25" % scope,
"uk.gov.hmrc" %% "hmrctest" % "3.9.0-play-25" % scope,
"uk.gov.hmrc" %% "reactivemongo-test" % "4.14.0-play-25" % scope,
"org.scalamock" %% "scalamock-scalatest-support" % "3.6.0" % scope,
"org.scalatest" %% "scalatest" % "3.0.4" % scope,
"org.scalatestplus.play" %% "scalatestplus-play" % "2.0.1" % scope,
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resolvers += "Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases/

addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "1.16.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-git-versioning" % "1.19.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "1.5.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "1.6.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-artifactory" % "0.19.0")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.19")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ class PublishApiDefinitionDisabledSpec extends PlatformIntegrationSpec {

"return a 404 from the definition endpoint" in new Setup {
val result = await(documentationController.definition()(request))
status(result) shouldBe 404
status(result) shouldBe 204
}

"return a 404 from the RAML endpoint" in new Setup {
val result = await(documentationController.raml("1.0", "application.raml")(request))
status(result) shouldBe 404
status(result) shouldBe 204
}
}
}

0 comments on commit 700b918

Please sign in to comment.