code: func (c *ValidateSpec) Execute(args []string) error {
  	if len(args) == 0 {
  		return errors.New(missingArgMsg)
  	}
  
  	swaggerDoc := args[0]
  
  	specDoc, err := loads.Spec(swaggerDoc)
  	if err != nil {
  		return err
  	}
  
  	// Attempts to report about all errors
  	validate.SetContinueOnErrors(!c.StopOnError)
  
  	v := validate.NewSpecValidator(specDoc.Schema(), strfmt.Default)
  	result, _ := v.Validate(specDoc) // returns fully detailed result with errors and warnings
  
  	if result.IsValid() {
  		log.Printf(validSpecMsg, swaggerDoc, specDoc.Version())
  	}
  	if result.HasWarnings() {
  		log.Printf(warningSpecMsg, swaggerDoc)
  		if !c.SkipWarnings {
  			log.Printf("See warnings below:\n")
  			for _, desc := range result.Warnings {
  				log.Printf("- WARNING: %s\n", desc.Error())
  			}
  		}
  	}
  	if result.HasErrors() {
  		str := fmt.Sprintf(invalidSpecMsg, swaggerDoc, specDoc.Version())
  		for _, desc := range result.Errors {
  			str += fmt.Sprintf("- %s\n", desc.Error())
  		}
  		return errors.New(str)
  	}
  
  	return nil
  }
docs: // Execute validates the spec