jamesfredley commented on issue #12623: URL: https://github.com/apache/grails-core/issues/12623#issuecomment-5943638060
This is not a defect in Grails JSON rendering. `respond` fails only when `org.grails:grails-datastore-rest-client` is on the classpath. That artifact brings its own `DomainClassMarshaller`, and the stack calls `GrailsDomainClass.getIdentifier()`. That method is not on `grails.core.GrailsDomainClass`. The current marshaller in this repository, `org.grails.web.converters.marshaller.json.DomainClassMarshaller.marshalObject`, resolves the id with `PersistentEntity.getIdentity()` and does not call `getIdentifier()`. `grails-datastore-rest-client` is not a module here. The report already says that without that dependency both `respond MyEntity.get(id)` and `respond "value"` work. The later `Multimap` comments are the same dependency (`org.grails:grails-datastore-rest-client:6.1.9.RELEASE`); rendering that type with Gson is a workaround for the extra marshaller, not a separate core bug. Calling REST services is documented with the Micronaut HTTP client, including `toBlocking()` for a non-reactive call: https://docs.grails.org/latest/guide/REST.html#callingRestServices Closing as not a Grails core bug. -- 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]
