Skip to content

Commit fdb491e

Browse files
committed
refactor: use a default contentType of application/json in Forms
1 parent d2d7833 commit fdb491e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/td-tools/src/thing-description.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export type ThingInteraction = TDT.PropertyElement | TDT.ActionElement | TDT.Eve
5656
export class Form implements TDT.FormElementBase {
5757
op?: string | string[];
5858
href: TDT.AnyUri;
59-
contentType?: string;
59+
contentType: string;
6060
contentCoding?: string;
6161
subprotocol?: TDT.Subprotocol;
6262
security?: TDT.Security;
@@ -67,7 +67,7 @@ export class Form implements TDT.FormElementBase {
6767

6868
constructor(href: string, contentType?: string) {
6969
this.href = href;
70-
if (contentType != null) this.contentType = contentType;
70+
this.contentType = contentType ?? "application/json";
7171
}
7272
}
7373
export interface ExpectedResponse {

0 commit comments

Comments
 (0)