diff options
author | Lvbo163 <lv.bo163@zte.com.cn> | 2017-09-06 14:32:16 +0800 |
---|---|---|
committer | Lvbo163 <lv.bo163@zte.com.cn> | 2017-09-06 14:32:16 +0800 |
commit | 15f0e4fa63bb1fd533091d9ab85d3612752c2d27 (patch) | |
tree | e844d16fc97ddef3ed1099998c7e251a41550820 /sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters | |
parent | 230109ebf31b922a5b84d8936ac3e9afbbf9e1b5 (diff) |
support set body parameter by json
Rest task's body parameter is definited by json object in swagger definition.
Issue-ID: SDC-67
Change-Id: Idb1d96cf9d1135afd7b285105abfdd9a2c50380c
Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters')
2 files changed, 10 insertions, 3 deletions
diff --git a/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters/rest-task-parameters.component.html b/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters/rest-task-parameters.component.html index 4f98e689..53f02f17 100644 --- a/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters/rest-task-parameters.component.html +++ b/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters/rest-task-parameters.component.html @@ -12,3 +12,7 @@ *******************************************************************************/ --> <b4t-parameter *ngFor="let param of requestParameters" [param]="param" [valueSource]= "inputSources"></b4t-parameter> + +<!-- body parameter --> +<b4t-parameter-tree [task]="task" [parameters]="bodyParameter" [valueSource]="inputSources" + [defaultValueSource]="valueSource[valueSource.String]"></b4t-parameter-tree> diff --git a/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters/rest-task-parameters.component.ts b/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters/rest-task-parameters.component.ts index f2d802c2..a50cc1be 100644 --- a/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters/rest-task-parameters.component.ts +++ b/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters/rest-task-parameters.component.ts @@ -18,6 +18,7 @@ import { RestTask } from '../../../../model/workflow/rest-task'; import { BroadcastService } from '../../../../services/broadcast.service'; import { RestParameter } from "../../../../model/workflow/rest-parameter"; import { ValueSource } from "../../../../model/value-source.enum"; +import { SwaggerTreeConverterService } from "../../../../services/swagger-tree-converter.service"; /** * property component presents information of a workflow node. @@ -39,7 +40,7 @@ export class RestTaskParametersComponent implements OnInit { private index = 1; - constructor(private broadcastService: BroadcastService) { + constructor(private broadcastService: BroadcastService, private swaggerTreeConverterService: SwaggerTreeConverterService) { } public ngOnInit() { @@ -55,8 +56,10 @@ export class RestTaskParametersComponent implements OnInit { this.task.parameters.forEach(param => { if (param.position === 'body') { - // TODO add body parameter handler - // this.bodyParameter.push(param); + const requestTreeNode = this.swaggerTreeConverterService + .schema2TreeNode('Request Param', this.task.serviceName, this.task.serviceVersion, param.schema); + param.value = param.schema.value; + this.bodyParameter.push(requestTreeNode); } else { this.requestParameters.push(param); } |