Comments (3)
Right now ModelMapper's validation is intended to verify that the structure of some class maps to the structure of another class, via the validate()
method. It is possible that the source object you use might have some null values which obviously would result in null values being set on the destination, but ModelMapper will still copy those null values over as long as the source/destination properties are mapped.
Can you give me a better idea of what you had in mind for asserting things?
from modelmapper.
I was thinking on the lines of code generation for asserts so that the developer knows exactly how things are getting mapped. Also, refactorings like field name changes can be guarded with the tests.
from modelmapper.
I think that code gen for assertions is outside the scope of ModelMapper for now. I would like to support any sort of validation that can be done without code gen, but code gen adds more complexity for users than I'd like.
I would encourage you to take a stab at building and publishing your own extension/library for this though. If you do, let me know when it's completed and I'll link to it on the site :)
from modelmapper.
Related Issues (20)
- How to skip not loaded Lazy fields?
- Test fails after upgrading from 3.1.0 to 3.1.1
- Java 21 support HOT 18
- Support of Java Module System
- Custom mapping in nested objects HOT 4
- Skip field of generic class HOT 1
- Mapping Source object to Destination object
- Mapping nested generic object with generic HOT 1
- Use specific converter for one field
- Model Mapper does not map values correctly (Intermittent - once in a few tries)
- Model Mapper Low performance
- Jackson Module: @JsonTypeInfo support for automatically handling inheritance HOT 1
- ModelMapper fails to map nested entity user field HOT 1
- When condition does not work for null-field
- How to ignore mapping errors HOT 1
- ModelMapper not working with nested generics
- modelmapper Hot deployment HOT 1
- How to Throw Validation exception when Source has a property that cannot be mapped to Destination HOT 1
- Test dependencies upgrade
- Basic Mapping doesn't work as expected.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modelmapper.