rmorrise opened a new issue, #14609:
URL: https://github.com/apache/grails-core/issues/14609
### Task List
- [x] Steps to reproduce provided
- [x] Stacktrace (if present) provided
- [x] Example that reproduces the problem uploaded to Github
- [x] Full description of the issue provided (see below)
### Steps to Reproduce
1. Check out and run the example project
2. POST to /master with the following data:
```
{
"details": [
{"detailType": "FOO", "fooProperty": "foo"},
{"detailType": "BAR", "barProperty": "bar"}
]
}
```
### Expected Behaviour
I think Grails should know how to automatically create a FooDetail and a
BarDetail by comparing the input discriminator property to the domain
subclasses that are mapped.
### Actual Behaviour
Grails creates a Detail which is neither FooDetail nor BarDetail, based on
the declared collection type in the Master class mapping. fooProperty and
barProperty are ignored. To get a correct mapping, it is necessary to customize
the binding (for example, by using a BindInitializer)
### Environment Information
- **Operating System**: Win7 x64
- **GORM Version:** 6.1.4.RELEASE
- **Grails Version (if using Grails):** 3.3.0.M2
- **JDK Version:** 1.8.0_131
### Example Application
-
[https://github.com/rmorrise/bindToSubclassExample](https://github.com/rmorrise/bindToSubclassExample)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]