diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/path-form.component.html b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/path-form.component.html index a06d65a19..44acd1bfd 100644 --- a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/path-form.component.html +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/path-form.component.html @@ -283,7 +283,24 @@ - +
+
+
TRACE
+ +
+ +
+ +
+
diff --git a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/path-form.component.ts b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/path-form.component.ts index 38b9047e3..49f229a9b 100644 --- a/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/path-form.component.ts +++ b/front-end/studio/src/app/pages/apis/{apiId}/editor/_components/forms/path-form.component.ts @@ -16,7 +16,7 @@ */ import {Component, EventEmitter, Input, Output, ViewChild, ViewEncapsulation} from "@angular/core"; -import {OasDocument, OasOperation, OasParameterBase, OasPathItem, OasPaths} from "oai-ts-core"; +import {Oas30PathItem, OasDocument, OasOperation, OasParameterBase, OasPathItem, OasPaths} from "oai-ts-core"; import {SourceFormComponent} from "./source-form.base"; import {ModelUtils} from "../../_util/model.util"; import { @@ -74,6 +74,10 @@ export class PathFormComponent extends SourceFormComponent { return this.path.ownerDocument(); } + public trace(): OasOperation { + return (this.path as Oas30PathItem).trace; + } + public hasGet(): boolean { return this.path.get !== undefined && this.path.get !== null; } @@ -95,6 +99,9 @@ export class PathFormComponent extends SourceFormComponent { public hasPatch(): boolean { return this.path.patch !== undefined && this.path.patch !== null; } + public hasTrace(): boolean { + return this.trace() !== undefined && this.trace() !== null; + } public getSummary(): string { return this.summary(this.path.get); @@ -124,6 +131,10 @@ export class PathFormComponent extends SourceFormComponent { return this.summary(this.path.head); } + public traceSummary(): string { + return this.summary(this.trace()); + } + private summary(operation: OasOperation): string { if (operation === null || operation === undefined) { return "Not Supported"; @@ -164,6 +175,10 @@ export class PathFormComponent extends SourceFormComponent { return this.description(this.path.head); } + public traceDescription(): string { + return this.description(this.trace()); + } + private description(operation: OasOperation): string { if (operation === null || operation === undefined) { return "Not Supported"; @@ -315,4 +330,7 @@ export class PathFormComponent extends SourceFormComponent { super.enableSourceMode(); } + public supportsTraceOperation(): boolean { + return this.document().is3xDocument(); + } }