Commit 2bf635e
committed
Reintroduced
In #751c259b, we removed the `attributePrefix` parameter because it was now being handled as part of the `PropertyConfiguration` object, which represented a much more elegant approach to relaying that context for `[MapToParent]`.
The only problem? We weren't passing a `PropertyConfiguration` object to to `ValidateModel`; instead, it was creating its own. And when it did? It wasn't actually passing the contextual `attributePrefix` to it. As such, when it recursed down to child properties, it was losing the context.
This bug was overlooked by the `Map_ComplexObject_ReturnsFlattenedTopic` unit test since the `Contact` content type had an `Email` attribute. As such, when the validator was supposed to be validating e.g. `AlternateEmail`, it was _actually_ validating `Email`, and passing. In a real-world scenario, however, this won't usually be the case, and defeats the benefit of validating the model against the content type.
This fix effectively undoes #751c259b, and restores the `BindingModelValidator` to its prior state.attributePrefix to BindingModelValidator
1 parent de79c61 commit 2bf635e
1 file changed
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
93 | | - | |
| 94 | + | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| |||
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
114 | | - | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| |||
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| 144 | + | |
142 | 145 | | |
143 | 146 | | |
144 | 147 | | |
145 | | - | |
| 148 | + | |
| 149 | + | |
146 | 150 | | |
147 | 151 | | |
148 | 152 | | |
| |||
156 | 160 | | |
157 | 161 | | |
158 | 162 | | |
159 | | - | |
| 163 | + | |
160 | 164 | | |
161 | 165 | | |
162 | 166 | | |
| |||
178 | 182 | | |
179 | 183 | | |
180 | 184 | | |
181 | | - | |
| 185 | + | |
| 186 | + | |
182 | 187 | | |
183 | 188 | | |
184 | 189 | | |
| |||
0 commit comments