code: func (step *StepModel) ValidateInputAndOutputEnvs(checkRequiredFields bool) error {
  	validateEnvs := func(envs []envmanModels.EnvironmentItemModel) error {
  		for _, env := range envs {
  			key, _, err := env.GetKeyValuePair()
  			if err != nil {
  				return fmt.Errorf("Invalid environment (%v), err: %s", env, err)
  			}
  
  			if err := env.Validate(); err != nil {
  				return fmt.Errorf("Invalid environment (%s), err: %s", key, err)
  			}
  
  			if checkRequiredFields {
  				options, err := env.GetOptions()
  				if err != nil {
  					return fmt.Errorf("Invalid environment (%s), err: %s", key, err)
  				}
  
  				if options.Title == nil || *options.Title == "" {
  					return fmt.Errorf("Invalid environment (%s), err: missing or empty title", key)
  				}
  
  				isSensitive := options.IsSensitive
  				if isSensitive == nil {
  					isSensitive = pointers.NewBoolPtr(envmanModels.DefaultIsSensitive)
  				}
  
  				isExpand := options.IsExpand
  				if isExpand == nil {
  					isExpand = pointers.NewBoolPtr(envmanModels.DefaultIsExpand)
  				}
  
  				if *isSensitive && !(*isExpand) {
  					return fmt.Errorf("Invalid environment (%s), err: is_sensitive option is true but is_expand option is not. For sensitive inputs direct value is not allowed", key)
  				}
  			}
  		}
  		return nil
  	}
  
  	return validateEnvs(append(step.Inputs, step.Outputs...))
  }
docs: // ValidateInputAndOutputEnvs ...