You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Stefan Seifert (Jira)" <ji...@apache.org> on 2021/12/03 09:33:00 UTC

[jira] [Assigned] (SLING-9793) Jackson exporter alphabetical sorting

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

Stefan Seifert reassigned SLING-9793:
-------------------------------------

    Assignee: Stefan Seifert

i'll have a look at this one.

we discovered that without explicit ordering it may happen that different instances in a cloud environment may output different orderings for JSON properties. this is not a problem for any JSON parsers, but it is a problem for CDN caching with etags. the same (unchanged) resource may be represented differently with different property orderings in JSON, which reduced the caching efficiency (and also complicated debugging in case you want to trace data problems in the generated JSONs by doing diffs, and get lots of differences only because of random reorderings).

there is already proposed PR: https://github.com/apache/sling-org-apache-sling-models-jacksonexporter/pull/3

> Jackson exporter alphabetical sorting
> -------------------------------------
>
>                 Key: SLING-9793
>                 URL: https://issues.apache.org/jira/browse/SLING-9793
>             Project: Sling
>          Issue Type: Improvement
>          Components: Sling Models
>            Reporter: Jasper Simon
>            Assignee: Stefan Seifert
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> It would be nice to have JSON properties sorted alphabetically by default when using the jackson exporter.
> If that is not possible, an OSGi configuration for the jackson exporter where you can define the default behaviour of the jackson exporter for your project.(org.apache.sling.models.jacksonexporter.impl.JacksonExporter)
> Now we need to add the sorting option for every exported class, while it would be beneficial to have this configured project-wide.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)