generated from ministryofjustice/hmpps-template-kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d45e67
commit 95ceff7
Showing
8 changed files
with
174 additions
and
25 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
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
64 changes: 64 additions & 0 deletions
64
src/main/kotlin/uk/gov/justice/digital/hmpps/learnerrecordsapi/openapi/NoMatchConfirmApi.kt
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,64 @@ | ||
package uk.gov.justice.digital.hmpps.learnerrecordsapi.openapi | ||
|
||
import io.swagger.v3.oas.annotations.Operation | ||
import io.swagger.v3.oas.annotations.Parameter | ||
import io.swagger.v3.oas.annotations.enums.ParameterIn | ||
import io.swagger.v3.oas.annotations.media.Content | ||
import io.swagger.v3.oas.annotations.media.ExampleObject | ||
import io.swagger.v3.oas.annotations.media.Schema | ||
import io.swagger.v3.oas.annotations.parameters.RequestBody | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse | ||
import io.swagger.v3.oas.annotations.security.SecurityRequirement | ||
import uk.gov.justice.digital.hmpps.learnerrecordsapi.config.Roles.ROLE_LEARNERS_UI | ||
import uk.gov.justice.digital.hmpps.learnerrecordsapi.models.request.ConfirmNoMatchRequest | ||
import uk.gov.justice.hmpps.kotlin.common.ErrorResponse | ||
|
||
@Target(AnnotationTarget.FUNCTION) | ||
@Retention(AnnotationRetention.RUNTIME) | ||
@Operation( | ||
summary = "Confirm a that a match is not possible", | ||
description = "Confirm a no match for a NomisID", | ||
parameters = [ | ||
Parameter(name = "X-Username", `in` = ParameterIn.HEADER, required = true), | ||
Parameter(name = "nomisId", `in` = ParameterIn.PATH, required = true), | ||
], | ||
requestBody = RequestBody( | ||
description = "ULN, Given Name, Family Name, Match Type, and Count of Returned ULNs to match with the NomisID in the path", | ||
required = true, | ||
content = [ | ||
Content( | ||
mediaType = "application/json", | ||
schema = Schema(implementation = ConfirmNoMatchRequest::class), | ||
examples = [ | ||
ExampleObject( | ||
name = "Confirm no match Request", | ||
value = """ | ||
{ | ||
"matchType": "NO_MATCH_RETURNED_FROM_LRS", | ||
"countOfReturnedUlns": "0" | ||
} | ||
""", | ||
), | ||
], | ||
), | ||
], | ||
), | ||
security = [SecurityRequirement(name = ROLE_LEARNERS_UI)], | ||
responses = [ | ||
ApiResponse( | ||
responseCode = "201", | ||
description = "The request was successful and the no match was recorded.", | ||
), | ||
ApiResponse( | ||
responseCode = "401", | ||
description = "Unauthorized to access this endpoint", | ||
content = [Content(mediaType = "application/json", schema = Schema(implementation = ErrorResponse::class))], | ||
), | ||
ApiResponse( | ||
responseCode = "403", | ||
description = "Forbidden to access this endpoint", | ||
content = [Content(mediaType = "application/json", schema = Schema(implementation = ErrorResponse::class))], | ||
), | ||
], | ||
) | ||
annotation class NoMatchConfirmApi |
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
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
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