jglapa opened a new issue, #15246:
URL: https://github.com/apache/grails-core/issues/15246
### Expected Behavior
Conversion of objects with the Validateable interface started complaining
about something related to creditCard validation... Works fine in grails 6
```groovy
class MyCommand implements grails.validation.Validateable {
Long id
}
def command = new MyCommand(id:10)
def result = command as grails.converters.JSON
assert result.toString() == '{"errors":{"errors":[]},"id":10}'.toString()
```
### Actual Behaviour
it fails:
```
Caused by: org.grails.web.converters.exceptions.ConverterException: Error
converting Bean with class grails.validation.ConstrainedDelegate
at
org.grails.web.converters.marshaller.json.GroovyBeanMarshaller.marshalObject(GroovyBeanMarshaller.java:88)
at
org.grails.web.converters.marshaller.json.GroovyBeanMarshaller.marshalObject(GroovyBeanMarshaller.java:43)
at grails.converters.JSON.value(JSON.java:205)
at grails.converters.JSON.convertAnother(JSON.java:165)
at
org.grails.web.converters.marshaller.json.MapMarshaller.marshalObject(MapMarshaller.java:47)
at
org.grails.web.converters.marshaller.json.MapMarshaller.marshalObject(MapMarshaller.java:32)
at grails.converters.JSON.value(JSON.java:205)
at grails.converters.JSON.convertAnother(JSON.java:165)
at
org.grails.web.converters.marshaller.json.GroovyBeanMarshaller.marshalObject(GroovyBeanMarshaller.java:70)
at
org.grails.web.converters.marshaller.json.GroovyBeanMarshaller.marshalObject(GroovyBeanMarshaller.java:43)
at grails.converters.JSON.value(JSON.java:205)
at grails.converters.JSON.render(JSON.java:140)
at
org.grails.web.converters.AbstractConverter.toString(AbstractConverter.java:123)
... 41 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at
org.grails.web.converters.marshaller.json.GroovyBeanMarshaller.marshalObject(GroovyBeanMarshaller.java:68)
... 53 common frames omitted
Caused by: groovy.lang.MissingPropertyException: CreditCard constraint only
applies to a String property
at
grails.gorm.validation.DefaultConstrainedProperty.isCreditCard(DefaultConstrainedProperty.groovy:403)
at
grails.validation.ConstrainedDelegate.isCreditCard(ConstrainedDelegate.groovy:124)
... 58 common frames omitted
```
### Steps To Reproduce
paste the snippet into a freshly bootstrapped project, can be a controller
action or even bootstrap init method
### Environment Information
_No response_
### Example Application
_No response_
### Version
7.0.2
--
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]