[Geoserver-devel] GeoServer SLD vs OGC Styles API mime types inconsistency

Hi,
GeoServer has been traditionally defined these two mime types for SLD 1.0 and 1.1:

public static final String MIMETYPE_10 = “application/vnd.ogc.sld+xml”;
public static final String MIMETYPE_11 = “application/vnd.ogc.se+xml”;

See: https://github.com/geoserver/geoserver/blob/e893e997434f0ca1b085896e27b1d774f8cafb6a/src/main/src/main/java/org/geoserver/catalog/SLDHandler.java#L66

However, the upcoming OGC Styles API uses:
application/vnd.ogc.sld+xml;version=1.0

application/vnd.ogc.sld+xml;version=1.1

See: https://github.com/opengeospatial/ogcapi-styles/blob/master/standard/clause_7_styles-api.adoc#requirements-class-ogc-sld-10

The same mimetypes are being used in other places, like the GeoPackage style extension I’m working on.

Now, the easy change would be to just update the mime types in the SLDHandler… doing so however may break
REST clients, as those mime types are used also to build MVC converters based on this API:

https://github.com/geoserver/geoserver/blob/e893e997434f0ca1b085896e27b1d774f8cafb6a/src/main/src/main/java/org/geoserver/catalog/SLDHandler.java#L128

I’d suggest to do the upgrade, but also add a new method, “alternativeMime(version) → List” that would return
mime types we keep for backwards compatibility, so that the REST API can keep on working against existing clients,
without requiring changes.

Opinions?

Cheers
Andrea

···

== GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

That sounds like a good plan to me. Not sure I really like mime types with suffix version numbers but no one asked me

Ian

···

Ian Turton

The approach sounds good.

···


Jody Garnett