handleSwaggerInfo() {
    const { Copy } = this.namespace.elements;

    if (this.swagger.info) {
      this.withPath('info', () => {
        if (this.swagger.info.title) {
          this.withPath('title', () => {
            this.api.title = this.swagger.info.title;

            if (this.generateSourceMap) {
              this.createSourceMap(this.api.meta.get('title'), this.path);
            }

            return this.api.meta.get('title');
          });
        }

        if (this.swagger.info.termsOfService) {
          this.withPath('termsOfService', () => {
            const { Link } = this.namespace.elements;
            const link = new Link();

            link.relation = 'terms-of-service';
            link.href = this.swagger.info.termsOfService;

            if (this.generateSourceMap) {
              this.createSourceMap(link, this.path);
            }

            return this.api.links.push(link);
          });
        }

        if (this.swagger.info.version) {
          this.withPath('version', () => {
            this.api.attributes.set('version', this.swagger.info.version);

            if (this.generateSourceMap) {
              this.createSourceMap(this.api.attributes.get('version'), this.path);
            }

            return this.api.attributes.get('version');
          });
        }

        if (this.swagger.info.description) {
          this.withPath('description', () => {
            const description = new Copy(this.swagger.info.description);
            this.api.content.push(description);

            if (this.generateSourceMap) {
              this.createSourceMap(description, this.path);
            }

            return description;
          });
        }

        if (this.swagger.info.contact) {
          this.withPath('contact', () => {
            const { Link } = this.namespace.elements;
            const { name, url, email } = this.swagger.info.contact;

            if (url) {
              this.withPath('url', () => {
                const link = new Link();
                link.relation = 'contact';
                link.href = url;

                if (name) {
                  link.title = name;
                }

                if (this.generateSourceMap) {
                  this.createSourceMap(link.href, this.path);
                }

                this.api.links.push(link);
              });
            }

            if (email) {
              this.withPath('email', () => {
                const link = new Link();
                link.relation = 'contact';
                link.href = `mailto:${email}`;

                if (!url && name) {
                  link.title = name;
                }

                if (this.generateSourceMap) {
                  this.createSourceMap(link.href, this.path);
                }

                this.api.links.push(link);
              });
            }
          });
        }

        this.handleSwaggerVendorExtensions(this.api, this.swagger.info);
      });
    }
  }
// Converts the Swagger title and description
Converts the Swagger title and description
Converts the Swagger title and description
handleSwaggerInfo() {
    const { Copy } = this.namespace.elements;
    if (this.swagger.info) {
      this.withPath('info', () => {
        if (this.swagger.info.title) {
          this.withPath('title', () => {
            this.api.title = this.swagger.info.title;
            if (this.generateSourceMap) {
              this.createSourceMap(this.api.meta.get('title'), this.path);
            }
            return this.api.meta.get('title');
          });
        }
        if (this.swagger.info.termsOfService) {
          this.withPath('termsOfService', () => {
            const { Link } = this.namespace.elements;
            const link = new Link();
            link.relation = 'terms-of-service';
            link.href = this.swagger.info.termsOfService;
            if (this.generateSourceMap) {
              this.createSourceMap(link, this.path);
            }
            return this.api.links.push(link);
          });
        }
        if (this.swagger.info.version) {
          this.withPath('version', () => {
            this.api.attributes.set('version', this.swagger.info.version);
            if (this.generateSourceMap) {
              this.createSourceMap(this.api.attributes.get('version'), this.path);
            }
            return this.api.attributes.get('version');
          });
        }
        if (this.swagger.info.description) {
          this.withPath('description', () => {
            const description = new Copy(this.swagger.info.description);
            this.api.content.push(description);
            if (this.generateSourceMap) {
              this.createSourceMap(description, this.path);
            }
            return description;
          });
        }
        if (this.swagger.info.contact) {
          this.withPath('contact', () => {
            const { Link } = this.namespace.elements;
            const { name, url, email } = this.swagger.info.contact;
            if (url) {
              this.withPath('url', () => {
                const link = new Link();
                link.relation = 'contact';
                link.href = url;
                if (name) {
                  link.title = name;
                }
                if (this.generateSourceMap) {
                  this.createSourceMap(link.href, this.path);
                }
                this.api.links.push(link);
              });
            }
            if (email) {
              this.withPath('email', () => {
                const link = new Link();
                link.relation = 'contact';
                link.href = `mailto:${email}`;
                if (!url && name) {
                  link.title = name;
                }
                if (this.generateSourceMap) {
                  this.createSourceMap(link.href, this.path);
                }
                this.api.links.push(link);
              });
            }
          });
        }
        this.handleSwaggerVendorExtensions(this.api, this.swagger.info);
      });
    }
  }
handleSwaggerInfo ( ) { const { Copy } = this . namespace . elements ; if ( this . swagger . info ) { this . withPath ( 'info' , ( ) => { if ( this . swagger . info . title ) { this . withPath ( 'title' , ( ) => { this . api . title = this . swagger . info . title ; if ( this . generateSourceMap ) { this . createSourceMap ( this . api . meta . get ( 'title' ) , this . path ) ; } return this . api . meta . get ( 'title' ) ; } ) ; } if ( this . swagger . info . termsOfService ) { this . withPath ( 'termsOfService' , ( ) => { const { Link } = this . namespace . elements ; const link = new Link ( ) ; link . relation = 'terms-of-service' ; link . href = this . swagger . info . termsOfService ; if ( this . generateSourceMap ) { this . createSourceMap ( link , this . path ) ; } return this . api . links . push ( link ) ; } ) ; } if ( this . swagger . info . version ) { this . withPath ( 'version' , ( ) => { this . api . attributes . set ( 'version' , this . swagger . info . version ) ; if ( this . generateSourceMap ) { this . createSourceMap ( this . api . attributes . get ( 'version' ) , this . path ) ; } return this . api . attributes . get ( 'version' ) ; } ) ; } if ( this . swagger . info . description ) { this . withPath ( 'description' , ( ) => { const description = new Copy ( this . swagger . info . description ) ; this . api . content . push ( description ) ; if ( this . generateSourceMap ) { this . createSourceMap ( description , this . path ) ; } return description ; } ) ; } if ( this . swagger . info . contact ) { this . withPath ( 'contact' , ( ) => { const { Link } = this . namespace . elements ; const { name , url , email } = this . swagger . info . contact ; if ( url ) { this . withPath ( 'url' , ( ) => { const link = new Link ( ) ; link . relation = 'contact' ; link . href = url ; if ( name ) { link . title = name ; } if ( this . generateSourceMap ) { this . createSourceMap ( link . href , this . path ) ; } this . api . links . push ( link ) ; } ) ; } if ( email ) { this . withPath ( 'email' , ( ) => { const link = new Link ( ) ; link . relation = 'contact' ; link . href = ` ${ email } ` ; if ( ! url && name ) { link . title = name ; } if ( this . generateSourceMap ) { this . createSourceMap ( link . href , this . path ) ; } this . api . links . push ( link ) ; } ) ; } } ) ; } this . handleSwaggerVendorExtensions ( this . api , this . swagger . info ) ; } ) ; } }
Converts the Swagger title and description
Converts the Swagger title and description