-
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 #1407
Feature: add validation for contract definition id #1372 #1407
Conversation
If we now would specify an incorrect ID, what would the error message look like? |
You would get "400 Bad Request" like other validation fails. |
Without any kind of error message? |
Unfortunately not like all other fields but as I can remember there were some discussions ongoing to improve the error handling or logging, maybe it exists already an issue for it. I think to improve the error handling was not part of this issue. |
@ndr-brt what do you think about this? In my opinion we should always consider to improve the error handling - also if we just fix a bug. @tuncaytunc-zf we have since a few days the Logging Guide. But I think that this special case is currently not be considered within the logging guide. In addition we also discussed this kind of error handling here: #1332 |
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.
I think this goes beyond the logging guide, as this information (failed input validation) is interesting for the client, but not for the server.
We should add some details in the response body when validation fails to make the client aware of what's needed to fix.
Talking about the PR, this detail (the interdiction of :
in contract definition id) should be described in the openapi specification
Codecov Report
@@ Coverage Diff @@
## main #1407 +/- ##
=============================================
- Coverage 67.61% 11.48% -56.13%
- Complexity 0 494 +494
=============================================
Files 719 719
Lines 15935 15936 +1
Branches 1043 1043
=============================================
- Hits 10774 1830 -8944
- Misses 4687 14001 +9314
+ Partials 474 105 -369
Continue to review full report at Codecov.
|
.../eclipse/dataspaceconnector/api/datamanagement/transferprocess/model/TransferRequestDto.java
Show resolved
Hide resolved
699d9d0
to
610f738
Compare
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
)