[server][oapif] Fix link rel property

This commit is contained in:
pathmapper 2024-09-24 07:36:17 +02:00
parent beca49c4e8
commit 71ed302093
2 changed files with 10 additions and 10 deletions

View File

@ -517,13 +517,13 @@ void QgsWfs3CollectionsHandler::handleRequest( const QgsServerApiContext &contex
"links", { "links", {
{ {
{ "href", href( context, QStringLiteral( "/%1/items" ).arg( shortName ), QgsServerOgcApi::contentTypeToExtension( QgsServerOgcApi::ContentType::JSON ) ) }, { "href", href( context, QStringLiteral( "/%1/items" ).arg( shortName ), QgsServerOgcApi::contentTypeToExtension( QgsServerOgcApi::ContentType::JSON ) ) },
{ "rel", QgsServerOgcApi::relToString( QgsServerOgcApi::Rel::item ) }, { "rel", QgsServerOgcApi::relToString( QgsServerOgcApi::Rel::items ) },
{ "type", QgsServerOgcApi::mimeType( QgsServerOgcApi::ContentType::GEOJSON ) }, { "type", QgsServerOgcApi::mimeType( QgsServerOgcApi::ContentType::GEOJSON ) },
{ "title", title + " as GeoJSON" } { "title", title + " as GeoJSON" }
}, },
{ {
{ "href", href( context, QStringLiteral( "/%1/items" ).arg( shortName ), QgsServerOgcApi::contentTypeToExtension( QgsServerOgcApi::ContentType::HTML ) ) }, { "href", href( context, QStringLiteral( "/%1/items" ).arg( shortName ), QgsServerOgcApi::contentTypeToExtension( QgsServerOgcApi::ContentType::HTML ) ) },
{ "rel", QgsServerOgcApi::relToString( QgsServerOgcApi::Rel::item ) }, { "rel", QgsServerOgcApi::relToString( QgsServerOgcApi::Rel::items ) },
{ "type", QgsServerOgcApi::mimeType( QgsServerOgcApi::ContentType::HTML ) }, { "type", QgsServerOgcApi::mimeType( QgsServerOgcApi::ContentType::HTML ) },
{ "title", title + " as HTML" } { "title", title + " as HTML" }
}/* TODO: not sure what these "concepts" are about, neither if they are mandatory }/* TODO: not sure what these "concepts" are about, neither if they are mandatory

View File

@ -30,13 +30,13 @@ Content-Type: application/json
"links": [ "links": [
{ {
"href": "http://server.qgis.org/wfs3/collections/testlayer%20%C3%A8%C3%A9/items.json", "href": "http://server.qgis.org/wfs3/collections/testlayer%20%C3%A8%C3%A9/items.json",
"rel": "item", "rel": "items",
"title": "A test wfs vector layer èé as GeoJSON", "title": "A test wfs vector layer èé as GeoJSON",
"type": "application/geo+json" "type": "application/geo+json"
}, },
{ {
"href": "http://server.qgis.org/wfs3/collections/testlayer%20%C3%A8%C3%A9/items.html", "href": "http://server.qgis.org/wfs3/collections/testlayer%20%C3%A8%C3%A9/items.html",
"rel": "item", "rel": "items",
"title": "A test wfs vector layer èé as HTML", "title": "A test wfs vector layer èé as HTML",
"type": "text/html" "type": "text/html"
} }
@ -71,13 +71,13 @@ Content-Type: application/json
"links": [ "links": [
{ {
"href": "http://server.qgis.org/wfs3/collections/layer1_with_short_name/items.json", "href": "http://server.qgis.org/wfs3/collections/layer1_with_short_name/items.json",
"rel": "item", "rel": "items",
"title": "A Layer1 with a short name as GeoJSON", "title": "A Layer1 with a short name as GeoJSON",
"type": "application/geo+json" "type": "application/geo+json"
}, },
{ {
"href": "http://server.qgis.org/wfs3/collections/layer1_with_short_name/items.html", "href": "http://server.qgis.org/wfs3/collections/layer1_with_short_name/items.html",
"rel": "item", "rel": "items",
"title": "A Layer1 with a short name as HTML", "title": "A Layer1 with a short name as HTML",
"type": "text/html" "type": "text/html"
} }
@ -112,13 +112,13 @@ Content-Type: application/json
"links": [ "links": [
{ {
"href": "http://server.qgis.org/wfs3/collections/exclude_attribute/items.json", "href": "http://server.qgis.org/wfs3/collections/exclude_attribute/items.json",
"rel": "item", "rel": "items",
"title": "A test vector layer exclude attrs as GeoJSON", "title": "A test vector layer exclude attrs as GeoJSON",
"type": "application/geo+json" "type": "application/geo+json"
}, },
{ {
"href": "http://server.qgis.org/wfs3/collections/exclude_attribute/items.html", "href": "http://server.qgis.org/wfs3/collections/exclude_attribute/items.html",
"rel": "item", "rel": "items",
"title": "A test vector layer exclude attrs as HTML", "title": "A test vector layer exclude attrs as HTML",
"type": "text/html" "type": "text/html"
} }
@ -153,13 +153,13 @@ Content-Type: application/json
"links": [ "links": [
{ {
"href": "http://server.qgis.org/wfs3/collections/fields_alias/items.json", "href": "http://server.qgis.org/wfs3/collections/fields_alias/items.json",
"rel": "item", "rel": "items",
"title": "A test vector layer with aliases as GeoJSON", "title": "A test vector layer with aliases as GeoJSON",
"type": "application/geo+json" "type": "application/geo+json"
}, },
{ {
"href": "http://server.qgis.org/wfs3/collections/fields_alias/items.html", "href": "http://server.qgis.org/wfs3/collections/fields_alias/items.html",
"rel": "item", "rel": "items",
"title": "A test vector layer with aliases as HTML", "title": "A test vector layer with aliases as HTML",
"type": "text/html" "type": "text/html"
} }