From 47ee7f2b56f5e264aeb9240f7b2e231f3dc74905 Mon Sep 17 00:00:00 2001 From: Alex Borodin Date: Thu, 12 Dec 2024 14:04:09 +0100 Subject: [PATCH] fixup: update CHANGELOG.md and openapi spec, return tm+json fetching by fetch name --- CHANGELOG.md | 4 ++++ api/tm-catalog.openapi.yaml | 4 ++-- internal/app/http/handler.go | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8d5f89..0400f31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,10 @@ - `check`: removed subcommands of `check` command, unifying both into the parent command - `repo`: reorganized commands that change repo config: renamed/created `config auth`, `config description`, and `config headers` commands +### Fixed + +- return "application/tm+json" as MIME type when fetching TMs via API + ## [v0.1.1] ### Added diff --git a/api/tm-catalog.openapi.yaml b/api/tm-catalog.openapi.yaml index 5da534f..48addb4 100644 --- a/api/tm-catalog.openapi.yaml +++ b/api/tm-catalog.openapi.yaml @@ -268,7 +268,7 @@ paths: **For the schema of the returned Thing Model see** [Thing Model JSON schema](https://github.com/w3c/wot-thing-description/blob/main/validation/tm-json-schema-validation.json) content: - application/json: + application/tm+json: schema: type: object '400': @@ -355,7 +355,7 @@ paths: **For the schema of the returned Thing Model see** [Thing Model JSON schema](https://github.com/w3c/wot-thing-description/blob/main/validation/tm-json-schema-validation.json) content: - application/json: + application/tm+json: schema: type: object '400': diff --git a/internal/app/http/handler.go b/internal/app/http/handler.go index bd5bdc1..5b15008 100644 --- a/internal/app/http/handler.go +++ b/internal/app/http/handler.go @@ -93,7 +93,7 @@ func (h *TmcHandler) GetThingModelByFetchName(w http.ResponseWriter, r *http.Req return } - HandleByteResponse(w, r, http.StatusOK, MimeJSON, data) + HandleByteResponse(w, r, http.StatusOK, MimeTMJSON, data) } // GetInventoryByID returns the metadata of a single TM by ID