-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #129 +/- ##
==========================================
+ Coverage 78.39% 78.64% +0.25%
==========================================
Files 30 30
Lines 671 693 +22
Branches 65 65
==========================================
+ Hits 526 545 +19
- Misses 111 114 +3
Partials 34 34
|
* @throws Exception if validation fails, including a list of validation errors. | ||
*/ | ||
fun validateMessage(message: Message) { | ||
val mapper = ObjectMapper() |
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.
You can use the jsonMapper
from Json.kt
instead of reinstantiating
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.
done
* @throws Exception if validation fails, including a list of validation errors. | ||
*/ | ||
fun validateData(data: Data, messageKind: String) { | ||
val mapper = ObjectMapper() |
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.
ditto: You can use the jsonMapper
from Json.kt
instead of reinstantiating
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.
done
Addresses #114, see also spec change TBD54566975/tbdex#206 and equivalent js PR TBD54566975/tbdex-js#134
There are a few places where we are not validating data upon Message/resource creation or sending. In those places, i added JSON Schema validations. These additional checks helped me find default data and test data that needed to be updated.