Skip to content

feat(UUID): add IRI validation that allows only to create IRIs using UUID version 4 and 5 (DEV-402) - #1990

Merged
mpro7 merged 16 commits into
mainfrom
wip/DEV-402
Feb 3, 2022
Merged

mpro7 merged 16 commits into
mainfrom
wip/DEV-402

Conversation

@mpro7

@mpro7 mpro7 commented Jan 31, 2022

Copy link
Copy Markdown
Contributor

resolves DEV-402

@mpro7
mpro7 marked this pull request as ready for review February 2, 2022 16:54
@mpro7
mpro7 requested a review from subotic as a code owner February 2, 2022 16:54
@mpro7
mpro7 requested a review from BalduinLandolt February 2, 2022 16:55
@mpro7 mpro7 changed the title add method that checks if UUID version is correct feat(UUID): add IRI validation that allows only to create IRIs using UUID version 4 and 5 (DEV-402) Feb 2, 2022

@BalduinLandolt BalduinLandolt left a comment

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.

looks good, apart from a few minor naming things

if (value.isEmpty) {
Validation.fail(BadRequestException(GROUP_IRI_MISSING_ERROR))
} else {
val isUUID: Boolean = sf.couldBeUuid(value.split("/").last)

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 find the function name couldBeUuid() confusing. Either it is or it's not, but could seems weird in this context

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.

You're partially right, because it only checks the length of string, so there is possibility checked string isn't the UUID, but I think to rename it.

@sonarqubecloud

sonarqubecloud Bot commented Feb 3, 2022

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@subotic subotic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks

@mpro7
mpro7 merged commit 74d4344 into main Feb 3, 2022
@mpro7
mpro7 deleted the wip/DEV-402 branch February 3, 2022 11:08
@mpro7 mpro7 self-assigned this Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants