handleSwaggerHost() {
    const { Member: MemberElement } = this.namespace.elements;

    if (this.swagger.host) {
      this.withPath('host', () => {
        let hostname = this.swagger.host;

        if (this.swagger.schemes) {
          if (this.swagger.schemes.length > 1) {
            this.createAnnotation(
              annotations.DATA_LOST, ['schemes'],
              'Only the first scheme will be used to create a hostname'
            );
          }

          hostname = `${this.swagger.schemes[0]}://${hostname}`;
        } else {
          hostname = `https://${hostname}`;
        }

        const metadata = [];
        const member = new MemberElement('HOST', hostname);

        member.meta.set('classes', ['user']);

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

        metadata.push(member);
        this.api.attributes.set('metadata', metadata);

        return member;
      });
    }
  }
// Converts the Swagger hostname and schemes to a Refract host metadata entry.
Converts the Swagger hostname and schemes to a Refract host metadata entry.
Converts the Swagger hostname and schemes to a Refract host metadata entry .
handleSwaggerHost() {
    const { Member: MemberElement } = this.namespace.elements;
    if (this.swagger.host) {
      this.withPath('host', () => {
        let hostname = this.swagger.host;
        if (this.swagger.schemes) {
          if (this.swagger.schemes.length > 1) {
            this.createAnnotation(
              annotations.DATA_LOST, ['schemes'],
              'Only the first scheme will be used to create a hostname'
            );
          }
          hostname = `${this.swagger.schemes[0]}://${hostname}`;
        } else {
          hostname = `https://${hostname}`;
        }
        const metadata = [];
        const member = new MemberElement('HOST', hostname);
        member.meta.set('classes', ['user']);
        if (this.generateSourceMap) {
          this.createSourceMap(member, this.path);
        }
        metadata.push(member);
        this.api.attributes.set('metadata', metadata);
        return member;
      });
    }
  }
handleSwaggerHost ( ) { const { Member : MemberElement } = this . namespace . elements ; if ( this . swagger . host ) { this . withPath ( 'host' , ( ) => { let hostname = this . swagger . host ; if ( this . swagger . schemes ) { if ( this . swagger . schemes . length > 1 ) { this . createAnnotation ( annotations . DATA_LOST , [ 'schemes' ] , 'Only the first scheme will be used to create a hostname' ) ; } hostname = ` ${ this . swagger . schemes [ 0 ] } ${ hostname } ` ; } else { hostname = ` ${ hostname } ` ; } const metadata = [ ] ; const member = new MemberElement ( 'HOST' , hostname ) ; member . meta . set ( 'classes' , [ 'user' ] ) ; if ( this . generateSourceMap ) { this . createSourceMap ( member , this . path ) ; } metadata . push ( member ) ; this . api . attributes . set ( 'metadata' , metadata ) ; return member ; } ) ; } }
Converts the Swagger hostname and schemes to a Refract host metadata entry.
Converts the Swagger hostname and schemes to a Refract host metadata entry .