From 5095e286c2774f8aa889ca6d34fbf91ee4570e50 Mon Sep 17 00:00:00 2001 From: Gabriel Roldan Date: Wed, 6 Jul 2022 23:59:00 -0300 Subject: [PATCH] ogcapi-images: Avoid ServiceException in WFS GetCapabilities `STACItemFeaturesResponse.getCapabilitiesElementName()` throws an `UnsupportedOperationException` instead of returning `null`, producing a `ServiceExceptionReport` when requesting a WFS 1.0.0 `GetCapabilities` document. `null` is a valid return value for this method, that results in `WFSGetFeatureOutputFormat.getCapabilitiesElementNames()` not contributing an output format name for the `WFSGetFeatureOutputFormat` in question. --- .../geoserver/api/images/STACItemFeaturesResponse.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/community/ogcapi/ogcapi-images/src/main/java/org/geoserver/api/images/STACItemFeaturesResponse.java b/src/community/ogcapi/ogcapi-images/src/main/java/org/geoserver/api/images/STACItemFeaturesResponse.java index 60b45415861..1e8bede8d4c 100644 --- a/src/community/ogcapi/ogcapi-images/src/main/java/org/geoserver/api/images/STACItemFeaturesResponse.java +++ b/src/community/ogcapi/ogcapi-images/src/main/java/org/geoserver/api/images/STACItemFeaturesResponse.java @@ -273,9 +273,15 @@ protected void writeCollectionBounds( // not needed in WFS3 } - /** capabilities output format string. */ + /** + * {@inheritDoc} + * + * @return {@code null}, making {@link WFSGetFeatureOutputFormat#getCapabilitiesElementNames()} + * not contributing a result format on the GetCapabilities document for this output format. + */ + @Override public String getCapabilitiesElementName() { - throw new UnsupportedOperationException(); + return null; } @Override