Skip to content

Commit

Permalink
Merge pull request #1051 from HeshanSudarshana/4.1.x-apictl-param-for…
Browse files Browse the repository at this point in the history
…mat-issue

[4.1.x] Add validation for empty configs value for params file
  • Loading branch information
npamudika authored Jan 24, 2024
2 parents 9f0857f + 265f141 commit 72c9feb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion import-export-cli/impl/importAPI.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func envParamsFileProcess(importPath, paramsPath, importEnvironment string) erro
}

// envParamsDirectoryProcess function is used to process the environment parameters when they are provided as a
//directory
// directory
func envParamsDirectoryProcess(importPath, paramsPath, importEnvironment string) error {
apiParams, err := params.LoadApiParamsFromDirectory(paramsPath)
if err != nil {
Expand Down Expand Up @@ -362,6 +362,10 @@ func handleCustomizedParameters(importPath, paramsPath, importEnvironment string
// Process env params and create the intermediate_params.yaml file to pass to the server
func handleEnvParams(tempDirectory string, destDirectory string, environmentParams *params.Environment) error {
// read api params from external parameters file
if len(environmentParams.Config) == 0 {
return errors.New("configs value is empty in the provided parameters")
}

envParamsJson, err := jsoniter.Marshal(environmentParams.Config)
if err != nil {
return err
Expand Down

0 comments on commit 72c9feb

Please sign in to comment.