Skip to content

ARCPOC-1407#489

Open
mharman1973 wants to merge 2 commits into
masterfrom
ARCPOC-1407
Open

ARCPOC-1407#489
mharman1973 wants to merge 2 commits into
masterfrom
ARCPOC-1407

Conversation

@mharman1973
Copy link
Copy Markdown
Contributor

Jira link

https://tools.hmcts.net/jira/browse/ARCPOC-1407

Change description

Produce error when submitting duplicate EntryId's to POST: application-lists/{app list id}/entries/officials

Testing done

Unit Tests
Integration Tests

Security Vulnerability Assessment

CVE Suppression: Are there any CVEs present in the codebase (either newly introduced or pre-existing) that are being intentionally suppressed or ignored by this commit?

  • Yes
  • No

Checklist

  • commit messages are meaningful and follow good commit message guidelines
  • README and other documentation has been updated / added (if needed)
  • tests have been updated / new tests has been added (if needed)
  • Does this PR introduce a breaking change

type: array
description: Array of entry IDs whose officials should be replaced. All must belong to the list in the path.
minItems: 1
uniqueItems: true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Removing this means the OpenAPI schema no longer declares that entryIds must be unique. Did this need to be removed to avoid duplicates being hidden from the code?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes having it in means that duplicates are silently ignored, so can't then check for duplicates. Catch-22 do we silently ignore them, or flag it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think flag so that consumers know. Maybe document that duplicates are rejected in the schema description as well.

@mustafaahmeddev
Copy link
Copy Markdown
Contributor

Please could you add a test to BulkUpdateOfficialsValidatorTest for the duplicate entry case?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see a new error has been added in the middle next to another error which begins with 'ENTRY'. I appreciate that it's nice to group them but this means other errors have been renumbered. I think it may be best to move the error to the end so that anyone using the old numbers isn't affected. Don't think anyone is but I believe best practice here is to append. We've been casual in the past but maybe better to be strict.

Copy link
Copy Markdown
Contributor

@mustafaahmeddev mustafaahmeddev left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up, I've suggested some changes.

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.

2 participants