How to use the apicurio-data-models.SimplifiedType 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 / shared / schema-type-editor.component.ts View on Github external
public changeType(type: string): void {
        let nt: SimplifiedType = new SimplifiedType();
        if (type === "enum") {
            nt.type = "string";
            nt.enum_ = [];
            nt.of = null;
            nt.as = null;
        } else {
            nt.type = type;
            nt.enum_ = null;
            nt.of = null;
            nt.as = null;
        }
        this.onChange.emit(nt);
    }
github Apicurio / apicurio-studio / front-end / studio / src / app / pages / apis / {apiId} / editor / _components / forms / shared / schema-type-editor.component.ts View on Github external
public changeTypeAs(typeAs: string): void {
        let nt: SimplifiedType = new SimplifiedType();
        nt.type = this.value.type;
        nt.enum_ = null;
        if (nt.isSimpleType()) {
            nt.of = null;
            nt.as = typeAs;
        }
        if (nt.isArray()) {
            nt.of = new SimplifiedType();
            nt.of.as = typeAs;
            if (this.value.of) {
                nt.of.type = this.value.of.type;
            }
        }
        this.onChange.emit(nt);
    }
github Apicurio / apicurio-studio / front-end / studio / src / app / pages / apis / {apiId} / editor / _components / forms / shared / schema-type-editor.component.ts View on Github external
public changeTypeOf(typeOf: string): void {
        let nt: SimplifiedType = new SimplifiedType();
        nt.type = this.value.type;
        nt.of = new SimplifiedType();
        nt.of.type = typeOf;
        nt.as = null;
        this.onChange.emit(nt);
    }
github Apicurio / apicurio-studio / front-end / studio / src / app / pages / apis / {apiId} / editor / _components / forms / shared / media-type-row.component.ts View on Github external
public changeType(newType: SimplifiedType): void {
        let nt: SimplifiedType = new SimplifiedType();
        nt.type = newType.type;
        nt.enum_ = newType.enum_;
        nt.of = newType.of;
        nt.as = newType.as;
        let command: ICommand = CommandFactory.createChangeMediaTypeTypeCommand(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 / shared / schema-type-editor.component.ts View on Github external
public changeTypeAs(typeAs: string): void {
        let nt: SimplifiedType = new SimplifiedType();
        nt.type = this.value.type;
        nt.enum_ = null;
        if (nt.isSimpleType()) {
            nt.of = null;
            nt.as = typeAs;
        }
        if (nt.isArray()) {
            nt.of = new SimplifiedType();
            nt.of.as = typeAs;
            if (this.value.of) {
                nt.of.type = this.value.of.type;
            }
        }
        this.onChange.emit(nt);
    }
github Apicurio / apicurio-studio / front-end / studio / src / app / pages / apis / {apiId} / editor / _components / forms / shared / schema-type-editor.component.ts View on Github external
public changeTypeOf(typeOf: string): void {
        let nt: SimplifiedType = new SimplifiedType();
        nt.type = this.value.type;
        nt.of = new SimplifiedType();
        nt.of.type = typeOf;
        nt.as = null;
        this.onChange.emit(nt);
    }
github Apicurio / apicurio-studio / front-end / studio / src / app / pages / apis / {apiId} / editor / _components / forms / shared / schema-type-editor.component.ts View on Github external
public changeTypeEnum(value: string[]): void {
        let nt: SimplifiedType = new SimplifiedType();
        nt.type = this.value.type;
        if (!nt.type) {
            nt.type = "string";
        }
        nt.enum_ = value;
        nt.of = null;
        nt.as = null;
        this.onChange.emit(nt);
    }