[jira] [Updated] (SLING-6966) Sling Models Jackson Exporter always uses default Resource serialization for a model class which extends AbstractResource or implements the Resource interface

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (SLING-6966) Sling Models Jackson Exporter always uses default Resource serialization for a model class which extends AbstractResource or implements the Resource interface

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/SLING-6966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Edelson updated SLING-6966:
----------------------------------
    Summary: Sling Models Jackson Exporter always uses default Resource serialization for a model class which extends AbstractResource or implements the Resource interface  (was: Sling Models Jackson Exporter always uses default Resource serialization for a model class which extends AbstractResource or implements the Resource implementation)

> Sling Models Jackson Exporter always uses default Resource serialization for a model class which extends AbstractResource or implements the Resource interface
> --------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-6966
>                 URL: https://issues.apache.org/jira/browse/SLING-6966
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Sling Models Jackson Exporter 1.0.6
>            Reporter: Justin Edelson
>            Assignee: Justin Edelson
>             Fix For: Sling Models Jackson Exporter 1.0.8
>
>
> If there is a model class which looks like this:
> {code}
> @Model(adaptable = SlingHttpServletRequest.class, resourceType = "something")
> @Exporter(name = "jackson", extensions = "json")
> public class Foo extends AbstractResource {
> ....
> }
> {code}
> Then attempts to export this resource will always use the default Resource serialization and not use the "bean" serialization technique used by Jackson. This is because Jackson will first find the ResourceSerializer based on the Resource interface before constructing a BeanSerializer. The serializer lookup logic should be customized to skip any class with the {{@Model}} annotation.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)