Skip to content

Commit

Permalink
refactor: use a default contentType of application/json in Forms
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Nov 29, 2023
1 parent 0a6463b commit 0b96413
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/td-tools/src/thing-description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down

0 comments on commit 0b96413

Please sign in to comment.