diff --git a/cmd/main_test.go b/cmd/main_test.go index 9edc4406..075396d0 100644 --- a/cmd/main_test.go +++ b/cmd/main_test.go @@ -56,6 +56,12 @@ func Test_newRouter(t *testing.T) { apiCall: "http://localhost:8180/collections/NewYork?f=html", wantBody: "internal/engine/testdata/expected_multiple_ogc_apis_single_collection.html", }, + { + name: "Serve JSON-LD in multiple OGC APIs for single collection in HTML", + configFile: "internal/engine/testdata/config_multiple_ogc_apis_single_collection.yaml", + apiCall: "http://localhost:8180/collections/NewYork?f=html", + wantBody: "internal/engine/testdata/expected_multiple_ogc_apis_single_collection_json_ld.html", + }, { name: "Serve multiple Feature Tables from single GeoPackage", configFile: "internal/ogc/features/testdata/config_features_bag_multiple_feature_tables.yaml", diff --git a/internal/engine/testdata/expected_multiple_ogc_apis_single_collection_json_ld.html b/internal/engine/testdata/expected_multiple_ogc_apis_single_collection_json_ld.html new file mode 100644 index 00000000..6a8efee1 --- /dev/null +++ b/internal/engine/testdata/expected_multiple_ogc_apis_single_collection_json_ld.html @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/internal/ogc/common/geospatial/templates/collection.go.html b/internal/ogc/common/geospatial/templates/collection.go.html index 377764f4..ea6e4654 100644 --- a/internal/ogc/common/geospatial/templates/collection.go.html +++ b/internal/ogc/common/geospatial/templates/collection.go.html @@ -29,7 +29,11 @@ {{- end }} "url": "{{ .Config.BaseURL }}/collections/{{ .Params.ID }}?f=html", {{- if and .Params.Metadata .Params.Metadata.Keywords -}} - "keywords": ["{{ .Params.Metadata.Keywords | join ", " }}"], + "keywords": [ + {{- range $i, $k := .Params.Metadata.Keywords -}} + {{- if $i -}},{{- end -}}"{{ $k }}" + {{- end -}} + ], {{- end -}} "license": "{{ .Config.License.URL }}", "isAccessibleForFree": true