You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Justin Edelson (JIRA)" <ji...@apache.org> on 2017/06/19 15:29:00 UTC

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

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

Justin Edelson resolved SLING-6966.
-----------------------------------
    Resolution: Fixed

fixed in r1799221, with unit test

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