How to use the apicurio-data-models.CommandFactory.createChangePropertyTypeCommand function in apicurio-data-models

To help you get started, we’ve selected a few apicurio-data-models examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Apicurio / apicurio-studio / front-end / studio / src / app / pages / apis / {apiId} / editor / _components / forms / definition / property-row.component.ts View on Github external
public changeType(newType: SimplifiedType): void {
        let nt: SimplifiedPropertyType = new SimplifiedPropertyType();
        nt.required = this.model().required;
        nt.type = newType.type;
        nt.enum_ = newType.enum_;
        nt.of = newType.of;
        nt.as = newType.as;
        let command: ICommand = CommandFactory.createChangePropertyTypeCommand(this.item, nt);
        this.commandService.emit(command);
        this._model = nt;
    }
github Apicurio / apicurio-studio / front-end / studio / src / app / pages / apis / {apiId} / editor / _components / forms / definition / property-row.component.ts View on Github external
public changeRequired(newValue: string): void {
        this.model().required = newValue === "required";
        let nt: SimplifiedPropertyType = SimplifiedPropertyType.fromPropertySchema(this.item);
        nt.required = this.model().required;
        let command: ICommand = CommandFactory.createChangePropertyTypeCommand(this.item, nt);
        this.commandService.emit(command);
    }