-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: add validation for contract definition id #1372
Feature: add validation for contract definition id #1372
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1372 +/- ##
=============================================
- Coverage 67.60% 11.40% -56.21%
- Complexity 0 488 +488
=============================================
Files 716 717 +1
Lines 15858 15889 +31
Branches 1041 1041
=============================================
- Hits 10721 1812 -8909
- Misses 4663 13972 +9309
+ Partials 474 105 -369
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot and will not force people to use the UUID format for ContractDefinition
s.
As per the linked issue, the problem should be solved in a different way, specifically to verify that the ID does not contain the ":" (colon) character, which is a one-liner.
Please either fix the code or withdraw the PR.
in addition, please re-generate the OpenApi documents and commit them, otherwise the build will fail. |
Hi @paullatzelsperger the idea to validate the contractDefinitionId against the UUID was coming from @jimmarino please see the comments in issue #1347, maybe he has a reason why to use UUID. Otherwise I can revert the PR and check only if the ID contains any ":". |
@jimmarino never said to validate against a UUID, or a GUID. Using a UUID is what we recommend, to ensure a high level of uniqueness, but APIs should never be opinionated like that unless there is a technical reason. |
My understanding from his comment "The id should be a GUID (not URN) so +1 on adding validation in the API. ..." was that the id should be a GUID and should be validated in the API :-) But as I said if there are no special reason to use UUID of course I will remove the UUID validation and only check if id contains a ":" |
@paullatzelsperger @jimmarino @tuncaytunc-zf Do we have to look also for other chars which should't be part of the ID? |
none that I can think of, from a technical perspective. |
I think this PR should be about 1-3 lines of code. We don't need to drag in validation dependencies into the core. |
Will close this PR and implement just to check if the id contains any ":". |
What this PR changes/adds
Add validation for contract definition id
Why it does that
Validation of contract definition id by creation solves the problem in negotiation process when the id is not valid.
Further notes
Marking jersey-bean-validation helps for the correct validation of parameters.
Linked Issue(s)
Closes #1347
Checklist
no-changelog
)