You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "gsartori (via GitHub)" <gi...@apache.org> on 2026/01/07 18:13:15 UTC

[I] Grails 7 - JSON-Views - g.render is generating the wrong JSON [grails-core]

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

   ### Expected Behavior
   
   This json-view:
   
   ```
   model {
       TProduction obj
   }
   
   json g.render(obj, [
       expand: ['artwork', 'artwork.colors', 'plates'],
       excludes: [],
   ])
   ```
   
   Produced something like this with Grails 6:
   ```
   {
       "id": 2,
       "dateCreated": "2025-12-22T21:56:47.196116",
       "plates": [
           {
               "id": 4,
               "width": 2000,
               "markplateKey": "XXX",
               "dateCreated": "2025-12-22T21:56:47.287394",
               "printerRef": "XXX",
               "lastUpdated": "2025-12-22T23:34:39.773883",
               "test": false,
               "production": {
                   "id": 2
               }
           },
           {
               "id": 5,
               "width": 2000,
               "markplateKey": "XXX",
               "dateCreated": "2025-12-22T21:56:47.327023",
               "printerRef": "XXX",
               "lastUpdated": "2025-12-22T21:56:47.335597",
               "test": false,
               "production": {
                   "id": 2
               }
           },
           {
               "id": 2,
               "width": 2000,
               "markplateKey": "XXX",
               "dateCreated": "2025-12-22T21:56:47.203744",
               "printerRef": "XXX",
               "lastUpdated": "2025-12-22T21:56:47.211625",
               "test": false,
               "production": {
                   "id": 2
               }
           },
           {
               "id": 3,
               "width": 2000,
               "markplateKey": "XXX",
               "dateCreated": "2025-12-22T21:56:47.246586",
               "printerRef": "XXX",
               "lastUpdated": "2025-12-22T21:56:47.254463",
               "test": false,
               "production": {
                   "id": 2
               }
           }
       ],
       "productionKey": "XXX",
       "agentCreated": "ONLINE",
       "usernameCreated": "user",
       "artwork": {
           "id": 2,
           "width": 800,
           "printerRef": "XXX",
           "dateCreated": "2025-12-22T21:56:47.165453",
           "widthRepetitions": 1,
           "lastUpdated": "2025-12-22T21:56:47.174548",
           "manufacturerCompany": {
               "id": 3
           },
           "colors": [
               {
                   "id": 7,
                   "width": 800,
                   "dateCreated": "2025-12-22T21:56:47.186169",
                   "rgb": "FFFF00",
                   "technology": "-",
                   "coverage": 200.0,
                   "printSide": "FRONT",
                   "material": {
                       "id": 1
                   }
               },
               {
                   "id": 5,
                   "width": 800,
                   "dateCreated": "2025-12-22T21:56:47.177355",
                   "rgb": "00FFFF",
                   "technology": "-",
                   "coverage": 200.0,
                   "printSide": "FRONT",
                   "material": {
                       "id": 1
                   }
               },
               {
                   "id": 8,
                   "width": 800,
                   "dateCreated": "2025-12-22T21:56:47.19077",
                   "rgb": "000000",
                   "technology": "-",
                   "coverage": 200.0,
                   "printSide": "FRONT",
                   "material": {
                       "id": 1
                   }
               },
               {
                   "id": 6,
                   "width": 800,
                   "dateCreated": "2025-12-22T21:56:47.181853",
                   "rgb": "FF00FF",
                   "technology": "-",
                   "coverage": 200.0,
                   "printSide": "FRONT",
                   "material": {
                       "id": 1
                   }
               }
           ]
       }
   }
   ```
   
   ### Actual Behaviour
   
   Now with Grails 7 the JSON gets produced like this:
   ```
   {
       "obj": {
           "id": 2,
           "dateCreated": "2025-12-22T21:56:47.196116",
           "usernameCreated": "user",
           "agentCreated": "ONLINE",
           "dateReceived": null,
           "usernameReceived": null,
           "companyReceived": null,
           "agentReceived": null,
           "dateDeleted": null,
           "usernameDeleted": null,
           "agentDeleted": null,
           "productionKey": "XXX",
           "artwork": {
               "id": 2
           },
           "plates": [
               {
                   "id": 5
               },
               {
                   "id": 2
               },
               {
                   "id": 4
               },
               {
                   "id": 3
               }
           ]
       }
   }
   ```
   
   ### Steps To Reproduce
   
   _No response_
   
   ### Environment Information
   
   _No response_
   
   ### Example Application
   
   _No response_
   
   ### Version
   
   7.0.4


-- 
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: notifications-unsubscribe@grails.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Grails 7 - JSON-Views - g.render is generating the wrong JSON [grails-core]

Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on issue #15306:
URL: https://github.com/apache/grails-core/issues/15306#issuecomment-3743648294

   I can't run the app as the `org.goowee` dependencies can't be resolved.
   But, it looks like the `gson-views` dependencies are not added to the app.


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Grails 7 - JSON-Views - g.render is generating the wrong JSON [grails-core]

Posted by "gsartori (via GitHub)" <gi...@apache.org>.
gsartori commented on issue #15306:
URL: https://github.com/apache/grails-core/issues/15306#issuecomment-3743564723

   @jamesfredley I've sent the invitations to the repository. You should be able to follow these steps:
   
   1. Clone `https://github.com/gsartori/json-view-issue`
   2. `bootRun` the app
   3. Execute the HTTP call found in `test-api.http`
   
   If needed for any reason you can login to the admin area of the website with `admin/admin` or `super/super`


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Grails 7 - JSON-Views - g.render is generating the wrong JSON [grails-core]

Posted by "gsartori (via GitHub)" <gi...@apache.org>.
gsartori commented on issue #15306:
URL: https://github.com/apache/grails-core/issues/15306#issuecomment-3743806514

   Oh man I feel so bad about it, we are working on so many things that we forgot that line in the porting.
   I'm sorry :/


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Grails 7 - JSON-Views - g.render is generating the wrong JSON [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on issue #15306:
URL: https://github.com/apache/grails-core/issues/15306#issuecomment-3721174240

   @gsartori Please provide a simple example application or TProduction with a test case in the Grails codebase.  


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Grails 7 - JSON-Views - g.render is generating the wrong JSON [grails-core]

Posted by "gsartori (via GitHub)" <gi...@apache.org>.
gsartori closed issue #15306: Grails 7 - JSON-Views - g.render is generating the wrong JSON
URL: https://github.com/apache/grails-core/issues/15306


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org