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.
Add Node object mapper
A Node object mapper is a useful abstraction for refactoring how
SmithyBuild transforms and plugins are implemented and simplifying
the definition of configurable validators. The NodeMapper is meant
to be very simple: there's no annotations, there's currently no
way to customize it beyond whether or not nulls are serialized and
if it fails/warns when missing keys are deserialized. It handles
the serialization/deserialization of primitives, strings, collections,
maps, POJOs, File, Path, URI, URL, Enum, and a few other things. The
way types are serialized and deserialized is meant to be compatible
with Jackson if we ever need to move over to it for whatever reason.
Compatibility means that we could swap out the NodeMapper implementation
in the future for Jackson or Jackson-JR if needed without breaking
the existing API. We can potentially open up the NodeMapper abstractions
for extension later, but that might lead us further away from Jackson
compatibility.
Why are we not just adding a dependency on Jackson? Mainly because it's
a ridiculously popular serialization library that spans lots of versions.
Adding a dependency on Jackson would cause a headache for the Smithy team,
service teams, and build teams within Amazon trying to deal with
depenency version conflicts. While implementing an object mapper adds a
lot of complexity and code to maintain, keeping dependencies minimal is
one of our primary project goals. Adding NodeMapper isn't a one-way door:
we can swap it out for Jackson databind in the future if needed.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.