From 4af2de4051ac62adf5defc0f3258d0aa74cd3e4d Mon Sep 17 00:00:00 2001 From: Ed Olivares <34591886+eudoroolivares2016@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:25:34 -0500 Subject: [PATCH] CMR-10210: content type is `text/yaml` in the response CMR-10210: Fix Documentation reference CMR-10210: Fix unit test --- src/__tests__/providerCatalog.spec.ts | 2 +- src/domains/collections.ts | 2 +- src/routes/catalog.ts | 2 +- src/routes/rootCatalog.ts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/__tests__/providerCatalog.spec.ts b/src/__tests__/providerCatalog.spec.ts index 05f4167..0da746b 100644 --- a/src/__tests__/providerCatalog.spec.ts +++ b/src/__tests__/providerCatalog.spec.ts @@ -109,7 +109,7 @@ describe("GET /:provider", () => { const link: Link = catalog.links.find((l: Link) => l.rel === "service-desc"); expect(link).to.have.property("rel", "service-desc"); - expect(link).to.have.property("type", "application/vnd.oai.openapi;version=3.0"); + expect(link).to.have.property("type", "text/yaml"); expect(link).to.have.property("href", "https://api.stacspec.org/v1.0.0-beta.1/openapi.yaml"); expect(link).to.have.property("title", "OpenAPI Doc"); }); diff --git a/src/domains/collections.ts b/src/domains/collections.ts index e496330..776d930 100644 --- a/src/domains/collections.ts +++ b/src/domains/collections.ts @@ -97,7 +97,7 @@ const extractLicense = (_collection: Collection) => { }; /** - * Examing a collections related URLs to see if it contains a reference to a STAC catalog. + * Examining a collections related URLs to see if it contains a reference to a STAC catalog. * If the collection has a RelatedURL of type: "GET CAPABILITIES", * and subtype: "STAC" then that URL should be placed in the href for the items link. * diff --git a/src/routes/catalog.ts b/src/routes/catalog.ts index 7d22986..8e0e9d2 100644 --- a/src/routes/catalog.ts +++ b/src/routes/catalog.ts @@ -51,7 +51,7 @@ const generateSelfLinks = (req: Request, nextCursor?: string | null, count?: num { rel: "service-desc", href: "https://api.stacspec.org/v1.0.0-beta.1/openapi.yaml", - type: "application/vnd.oai.openapi;version=3.0", + type: "text/yaml", title: "OpenAPI Doc", }, { diff --git a/src/routes/rootCatalog.ts b/src/routes/rootCatalog.ts index d89ddd3..26a8ce6 100644 --- a/src/routes/rootCatalog.ts +++ b/src/routes/rootCatalog.ts @@ -26,8 +26,8 @@ const selfLinks = (req: Request): Link[] => { { rel: "service-desc", href: `https://api.stacspec.org/v1.0.0-beta.1/openapi.yaml`, - title: "OpenAI Documentation", - type: "application/vnd.oai.openapi;version=3.0", + title: "OpenAPI Documentation", + type: "text/yaml", }, { rel: "service-doc",