How to use the apicurio-data-models.VisitorUtil.visitTree 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 / editors / security-scheme-editor.component.ts View on Github external
protected initModel(scheme?: SecurityScheme): void {
        this.schemeExists = false;
        let schemeNames: string[] = [];
        VisitorUtil.visitTree(this.context.ownerDocument(), new class extends CombinedVisitorAdapter {
            public visitSecurityScheme(node: SecurityScheme): void {
                schemeNames.push(node.getName());
            }
        }, TraverserDirection.down);
        this.schemeNames = schemeNames;

        if (this.context.ownerDocument().getDocumentType() == DocumentType.openapi2) {
            this.model = {
                schemeName: null,
                description: null,
                type: null,
                name: null,
                in: null,
                flow: null,
                authorizationUrl: null,
                tokenUrl: null,