Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public changeOperationId(newOperationId: string): void {
console.info("[InfoSectionComponent] User changed the operationId.");
let command: ICommand = CommandFactory.createChangePropertyCommand(this.operation, "operationId", newOperationId);
this.commandService.emit(command);
}
public onProducesChange(newValue: string[]): void {
console.info("[InfoSectionComponent] User changed the produces to: ", newValue);
if (newValue && newValue.length === 0) {
newValue = null;
}
let command: ICommand = CommandFactory.createChangePropertyCommand(this.operation, "produces", newValue);
this.commandService.emit(command);
this._initConsumesProduces();
}
public onConsumesChange(newValue: string[]): void {
console.info("[InfoSectionComponent] User changed the consumes to: ", newValue);
if (newValue && newValue.length === 0) {
newValue = null;
}
let command: ICommand = CommandFactory.createChangePropertyCommand(this.operation, "consumes", newValue);
this.commandService.emit(command);
this._initConsumesProduces();
}
public onExampleChange(newExample: string): void {
console.info("[DefinitionExampleSectionComponent] User changed the data type example.");
let newValue: any = newExample;
if (StringUtils.isJSON(newValue)) {
try {
newValue = JSON.parse(newValue);
} catch (e) {
console.info("[DefinitionExampleSectionComponent] Failed to parse example: ", e);
}
}
let command: ICommand = CommandFactory.createChangePropertyCommand(this.definition,"example", newValue);
this.commandService.emit(command);
}
public changeSummary(newSummary: string): void {
console.info("[InfoSectionComponent] User changed the summary.");
let command: ICommand = CommandFactory.createChangePropertyCommand(this.operation, "summary", newSummary);
this.commandService.emit(command);
}
public changeSummary(newSummary: string): void {
console.info("[InfoSectionComponent] User changed the summary.");
let command: ICommand = CommandFactory.createChangePropertyCommand(this.path, "summary", newSummary);
this.commandService.emit(command);
}
public changeTags(newTags: string[]): void {
console.info("[InfoSectionComponent] User changed the tags.");
let command: ICommand = CommandFactory.createChangePropertyCommand(this.operation, "tags", newTags);
this.commandService.emit(command);
}
public setDescription(description: string): void {
let command: ICommand = CommandFactory.createChangePropertyCommand(this.scheme, "description", description);
this.commandService.emit(command);
let path = Library.createNodePath(this.scheme);
path.appendSegment("description", false);
this.selectionService.select(path.toString());
}
public setDescription(description: string): void {
let command: ICommand = CommandFactory.createChangePropertyCommand(this.response, "description", description);
this.commandService.emit(command);
}
public changeContactURL(newValue: string): void {
if (!newValue) { newValue = null; }
let command: ICommand = CommandFactory.createChangePropertyCommand(this.contact(), "url", newValue);
this.commandService.emit(command);
}