Skip to content

Conversation

@karen-hedges
Copy link
Contributor

@karen-hedges karen-hedges commented Oct 14, 2025

JIRA link (if applicable)

https://tools.hmcts.net/jira/browse/DMP-5271

Change description

Added input validation to get transcription document as well as ensuring response codes are single quote

  • Added minimum and maximum values to transcriptions.yaml as well as corresponding error.
  • Added updates to Authorisation.impl to handle negative transcription IDs by throwing a BadRequestException.
  • Added util method to check if a number is within minimum and maximum bounds
  • Added swagger-request-validator-core library and tests in TranscriptionOpenApiContractTest to confirm that minimum and maximum values checking is applied. Note this only validates transcriptions.yaml and not the response returned by the application. Further integration tests were added in TranscriptionControllerDownloadTranscriptIntTest to confirm that the actual response for a negative transcription ID is a 400. The application already handles requests with a transcription ID that is higher than the maximum allowed value with a 400 response.

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[x] No

…en — apply input validation (High)

Added input validation to get transcription document as well as ensuring response codes are single quoted
…en — apply input validation (High)

Added input validation to get transcription document as well as ensuring response codes are single quoted
…en — apply input validation (High)

Added input validation to get transcription document as well as ensuring response codes are single quoted
…en — apply input validation (High)

Added input validation to get transcription document as well as ensuring response codes are single quoted
…scriptionsDocument' into DMP-5271-AddApiValidationGetTranscriptionsDocument
).build();

@Test
void negativeTranscriptionId() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add to the method name the name of the method for controllers get transcription document which I think is attachTranscript

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test will not reach the controller but I have updated the naming to be clearer

- "Too many results"
- "Transcription document marked for deletion reason not found"
- "Failed to upload transcript"
- "Invalid transcription id"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there an extra whitespace here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed whitespace

karen-hedges and others added 11 commits October 31, 2025 11:05
…en — apply input validation (High)

Added input validation to get transcription document as well as ensuring response codes are single quoted
…en — apply input validation (High)

Added input validation to get transcription document as well as ensuring response codes are single quoted
…en — apply input validation (High)

Added input validation to get transcription document as well as ensuring response codes are single quoted
…en — apply input validation (High)

Added input validation to get transcription document as well as ensuring response codes are single quoted
@Itneet Itneet force-pushed the DMP-5271-AddApiValidationGetTranscriptionsDocument branch from 3cdf6b3 to 8c408b7 Compare October 31, 2025 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants