Skip to content
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

Add a Node object mapper #301

Merged
merged 0 commits into from
Mar 5, 2020
Merged

Add a Node object mapper #301

merged 0 commits into from
Mar 5, 2020

Conversation

mtdowling
Copy link
Member

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.

@mtdowling mtdowling changed the title Custom node serde Add a Node object mapper Mar 4, 2020
@mtdowling mtdowling force-pushed the custom-node-serde branch from ae738e8 to 32eb252 Compare March 4, 2020 22:25
@mtdowling mtdowling requested a review from kstich March 4, 2020 22:25
@mtdowling mtdowling merged this pull request into 0.10 Mar 5, 2020
@mtdowling mtdowling deleted the custom-node-serde branch March 10, 2020 23:00
@kstich kstich mentioned this pull request Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants