From 0b964132998c1b5c710eae6cf5959a5cd34fbdd1 Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Wed, 29 Nov 2023 13:40:44 +0100 Subject: [PATCH] refactor: use a default contentType of application/json in Forms --- packages/td-tools/src/thing-description.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/td-tools/src/thing-description.ts b/packages/td-tools/src/thing-description.ts index adc234b37..8e7fd9d95 100644 --- a/packages/td-tools/src/thing-description.ts +++ b/packages/td-tools/src/thing-description.ts @@ -56,7 +56,7 @@ export type ThingInteraction = TDT.PropertyElement | TDT.ActionElement | TDT.Eve export class Form implements TDT.FormElementBase { op?: string | string[]; href: TDT.AnyUri; - contentType?: string; + contentType: string; contentCoding?: string; subprotocol?: TDT.Subprotocol; security?: TDT.Security; @@ -67,7 +67,7 @@ export class Form implements TDT.FormElementBase { constructor(href: string, contentType?: string) { this.href = href; - if (contentType != null) this.contentType = contentType; + this.contentType = contentType ?? "application/json"; } } export interface ExpectedResponse {