Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overall, it is a well tested and library providing good type-safety and convenience to the user.
I liked the testing of the type classes with ScalaCheck and Discipline, while also having concrete test cases with manual sample data, acting also as a guidance of the intended usage of the methods.
In terms of improvements to the existing form of the library, I would:
Provide more clarity on the use-case of the two
apply
methods onEncoder
andDecoder
, possibly reducing them to one.The usage of Shapeless is impressive but rather complicated. I would like to see more concrete use cases for this and maybe simplify it by separating concerns to make it more approachable to users.
Ideas/suggestions on improving it:
I found it a bit hard to find what is the main added value of the library (a generically derived
DynamoDBSerializer
). I would like to make the code lead more naturally to this.Using Shapeless: I would investigate the usage of
LabelledGeneric
and annotating the keys with the type symbol instead of String name of the column. This might also simplify the type-level derivation since it could match case class field to theKey
tagged with the same label.Possibly use SourceCode to get the key names when explicitly assigning them
Allow encoding/decoding of nested case classes