How to use the apicurio-data-models.VisitorUtil.visitNode 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 / common / validation-aggregate.component.ts View on Github external
public matchingProblems(): ValidationProblem[] {
        if (!this.models) {
            return [];
        }

        // Find the relevant problems if not cached.
        if (this._problems === undefined) {
            this.log("Cache empty, finding matching problems.");
            let finder: ProblemFinder = new ProblemFinder(this.properties, this.codes);
            for (let model of this.models) {
                if (model !== null && model !== undefined) {
                    if (this.shallow) {
                        VisitorUtil.visitNode(model, finder);
                    } else {
                        VisitorUtil.visitTree(model, finder, TraverserDirection.down);
                    }
                }
            }
            this._problems = finder.getProblems();
        }

        return this._problems;
    }
github Apicurio / apicurio-studio / front-end / studio / src / app / pages / apis / {apiId} / editor / _components / common / validation-problem.component.ts View on Github external
public validationProblems(): ValidationProblem[] {
        if (this._problems === undefined) {
            if (this._model) {

                if (this.debug) {
                    console.info("Getting the list of problems!");
                }

                let props: string[] = this.property ? [this.property] : null;
                let codes: string[] = this.code ? [this.code] : null;
                let finder: ProblemFinder = new ProblemFinder(props, codes);

                if (this.shallow) {
                    VisitorUtil.visitNode(this.model, finder);
                } else {
                    VisitorUtil.visitTree(this.model, finder, TraverserDirection.down);
                }

                this._problems = finder.getProblems();
            } else {
                this._problems = [];
            }
        }
        return this._problems;
    }