theiosdevguy opened a new issue, #14399:
URL: https://github.com/apache/grails-core/issues/14399

   Hi Grails Team,
   
   How do I enable RestfulController to auto-map the dynamic fields to domain 
classes? I have a domain class as below:
   
   ```
   class Company implements MongoEntity<Company> {
       String id = UUID.randomUUID().toString()
       String name
       String email
       String phone
   }
   ```
   
   And I have a RestfulController setup for CRUD operations as below
   
   ```
   class CompanyController extends RestfulController<Company> {
   
   @Transactional
       def save(Company company) {
           if(company.hasErrors()) {
               respond company.errors
           }
           else {
               company.insert(flush:true)
               respond company, status: CREATED
           }
       }
   }
   ```
   When I POST a request with some additional JSON fields, how do I get them 
auto-mapped to gorm_dynamic_attributes ? Currently the company object does not 
return any information on the dynamic attributes. Another problem I am facing 
is that `request.JSON` is also null so I cannot manually map either.
   
   Please suggest.
   
   Thanks.


-- 
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]

Reply via email to