-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PS|SS] TAV-223 - Add json and raml api definitions for address-lookup
- Loading branch information
1 parent
b85086a
commit 17fea89
Showing
5 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2021 HM Revenue & Customs | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package apiplatform | ||
|
||
import controllers.Assets | ||
import javax.inject.Inject | ||
import play.api.mvc.{Action, AnyContent, ControllerComponents} | ||
import uk.gov.hmrc.play.bootstrap.backend.controller.BackendController | ||
|
||
class DocumentationController @Inject()(assets: Assets, cc: ControllerComponents) extends BackendController(cc) { | ||
def definition(): Action[AnyContent] = { | ||
assets.at("/public/api", "definition.json") | ||
} | ||
|
||
def raml(version: String, file: String): Action[AnyContent] = { | ||
assets.at(s"/public/api/conf/$version", file) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
GET /api/definition apiplatform.DocumentationController.definition() | ||
GET /api/conf/:version/*file apiplatform.DocumentationController.raml(version, file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#%RAML 1.0 | ||
--- | ||
title: Address Lookup | ||
version: 1.0 | ||
|
||
protocols: [ HTTPS ] | ||
baseUri: https://address-lookup.service.hmrc.gov.uk/ | ||
|
||
documentation: | ||
- title: Overview | ||
content: !include docs/overview.md | ||
- title: Versioning | ||
content: !include https://developer.service.hmrc.gov.uk/api-documentation/assets/common/docs/versioning.md | ||
- title: Errors | ||
content: !include https://developer.service.hmrc.gov.uk/api-documentation/assets/common/docs/errors.md | ||
|
||
mediaType: application/hal+json | ||
|
||
uses: | ||
sec: https://developer.service.hmrc.gov.uk/api-documentation/assets/common/modules/securitySchemes.raml | ||
headers: https://developer.service.hmrc.gov.uk/api-documentation/assets/common/modules/headers.raml | ||
annotations: https://developer.service.hmrc.gov.uk/api-documentation/assets/common/modules/annotations.raml | ||
types: https://developer.service.hmrc.gov.uk/api-documentation/assets/common/modules/types.raml | ||
|
||
/lookup: | ||
/address: | ||
get: | ||
displayName: Lookup address | ||
description: | | ||
Lookup of postal and BFPO (British Forces Post Office) address details within the UK | ||
is: [headers.acceptHeader] | ||
responses: | ||
200: | ||
body: | ||
application/json: | ||
example: | | ||
{ | ||
"message" : "Hello World" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"scopes": [ | ||
{ | ||
"key": "lookup-address", | ||
"name": "Lookup address", | ||
"description": "Lookup of postal and BFPO (British Forces Post Office) address details within the UK" | ||
} | ||
], | ||
"api": { | ||
"name": "Lookup address", | ||
"description": "Lookup of postal and BFPO (British Forces Post Office) address details within the UK", | ||
"context": "misc/address-validation", | ||
"versions": [ | ||
{ | ||
"version": "1.0", | ||
"status": "ALPHA", | ||
"endpointsEnabled": true | ||
} | ||
] | ||
} | ||
} |