feat(runtime): add support for omitting null values in generated mappers#97
Merged
feat(runtime): add support for omitting null values in generated mappers#97
Conversation
- Introduced `OmitNullValues` in mapper options and attributes to control null omission behavior. - Added `SetIfNotNull` extension method on `AttributeValue` for conditional attribute setting. - Updated nested object/collection property mapping logic to respect `OmitNullValues` settings. - Deprecated `OmitNullStrings` in favor of `OmitNullValues` for broader applicability. - Enhanced tests to verify new null omission feature functionality.
…ssion - Added generated snapshot files for `NestedObjectVerifyTests`. - Verified behavior for dot notation null omission and inline nullable handling. - Ensured nested mappers respect null omission settings in all scenarios.
- Updated `<VersionPrefix>` to `1.1.0` to prepare for the next release. - Minor formatting adjustments to metadata items for consistency.
- Introduced handling for `OmitNullValuesSpecified` to prioritize explicit settings. - Replaced `.Set(...)` with `.SetIfNotNull(...)` for conditional null checks in mappings. - Updated logic in nested object and collection mappings to respect `OmitNullValues` behavior. - Added snapshots for new test cases, including `ExplicitOmitNullValuesFalse` and inline nullable checks. - Adjusted default `OmitNullValues` to `true` in both runtime attributes and generator options.
- Added a new `publish` task for publishing packages to NuGet. - Introduced `dotenv` support in `taskfile.yaml` for environment variable management. - Updated `.gitignore` to include `.env` file exclusion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
OmitNullValues, deprecate legacyOmitNullStrings, and preserve null-omit overrides through nested mapping analysisToItemcode soOmitIfNullworks uniformly for nested object and nested collection properties, including deeper dot-notation pathsskills/dynamo-mapperreferencesTesting
dotnet test --project test/LayeredCraft.DynamoMapper.Runtime.Tests/LayeredCraft.DynamoMapper.Runtime.Tests.csproj