@@ -320,19 +320,19 @@ const addCollectionLinks = function (results, endpoint) {
320
320
// self link
321
321
links . splice ( 0 , 0 , {
322
322
rel : 'self' ,
323
- type : 'application/geo+ json' ,
323
+ type : 'application/json' ,
324
324
href : `${ endpoint } /collections/${ id } `
325
325
} )
326
326
// parent catalog
327
327
links . push ( {
328
328
rel : 'parent' ,
329
- type : 'application/geo+ json' ,
329
+ type : 'application/json' ,
330
330
href : `${ endpoint } `
331
331
} )
332
332
// root catalog
333
333
links . push ( {
334
334
rel : 'root' ,
335
- type : 'application/geo+ json' ,
335
+ type : 'application/json' ,
336
336
href : `${ endpoint } `
337
337
} )
338
338
// child items
@@ -372,7 +372,7 @@ const addItemLinks = function (results, endpoint) {
372
372
// root catalog
373
373
links . push ( {
374
374
rel : 'root' ,
375
- type : 'application/geo+ json' ,
375
+ type : 'application/json' ,
376
376
href : `${ endpoint } `
377
377
} )
378
378
links . push ( {
@@ -465,7 +465,8 @@ const buildPaginationLinks = function (limit, parameters, bbox, intersects, endp
465
465
const link = {
466
466
rel : 'next' ,
467
467
title : 'Next page of Items' ,
468
- method : httpMethod
468
+ method : httpMethod ,
469
+ type : 'application/geo+json'
469
470
}
470
471
if ( httpMethod === 'GET' ) {
471
472
const nextQueryParameters = dictToURI ( nextParams )
@@ -515,9 +516,11 @@ const searchItems = async function (collectionId, queryParameters, backend, endp
515
516
} )
516
517
517
518
let newEndpoint = `${ endpoint } /search`
519
+ let collectionEndpoint
518
520
if ( collectionId ) {
519
521
searchParams . collections = [ collectionId ]
520
522
newEndpoint = `${ endpoint } /collections/${ collectionId } /items`
523
+ collectionEndpoint = `${ endpoint } /collections/${ collectionId } `
521
524
}
522
525
523
526
logger . debug ( `Search parameters: ${ JSON . stringify ( searchParams ) } ` )
@@ -551,13 +554,18 @@ const searchItems = async function (collectionId, queryParameters, backend, endp
551
554
links = paginationLinks . concat ( [
552
555
{
553
556
rel : 'self' ,
554
- type : 'application/json' ,
555
- href : ` ${ newEndpoint } `
557
+ type : 'application/geo+ json' ,
558
+ href : newEndpoint
556
559
} ,
557
560
{
558
561
rel : 'root' ,
559
- type : 'application/geo+json' ,
560
- href : `${ endpoint } `
562
+ type : 'application/json' ,
563
+ href : endpoint
564
+ } ,
565
+ {
566
+ rel : 'collection' ,
567
+ type : 'application/json' ,
568
+ href : collectionEndpoint
561
569
}
562
570
] )
563
571
} else {
@@ -666,7 +674,7 @@ const aggregate = async function (queryParameters, backend, endpoint, httpMethod
666
674
} ,
667
675
{
668
676
rel : 'root' ,
669
- type : 'application/geo+ json' ,
677
+ type : 'application/json' ,
670
678
href : `${ endpoint } `
671
679
} ]
672
680
}
@@ -702,12 +710,12 @@ const getCatalog = async function (txnEnabled, backend, endpoint = '') {
702
710
const links = [
703
711
{
704
712
rel : 'self' ,
705
- type : 'application/geo+ json' ,
713
+ type : 'application/json' ,
706
714
href : `${ endpoint } `
707
715
} ,
708
716
{
709
717
rel : 'root' ,
710
- type : 'application/geo+ json' ,
718
+ type : 'application/json' ,
711
719
href : `${ endpoint } `
712
720
} ,
713
721
{
@@ -781,7 +789,7 @@ const getCollections = async function (backend, endpoint = '') {
781
789
} ,
782
790
{
783
791
rel : 'root' ,
784
- type : 'application/geo+ json' ,
792
+ type : 'application/json' ,
785
793
href : `${ endpoint } ` ,
786
794
} ,
787
795
] ,
0 commit comments