Skip to content

Commit

Permalink
added the ability to pass json content not only as a file with the js…
Browse files Browse the repository at this point in the history
…on extension

Signed-off-by: Makarii Balashov <[email protected]>
  • Loading branch information
ya-makariy committed Jul 8, 2024
1 parent c760bee commit 40df200
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/payload/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func Load(path string) (any, error) {
}
var payload any
switch {
case file.IsJson(path):
case file.IsJson(path) || json.Valid(content):
if err := json.Unmarshal(content, &payload); err != nil {
return nil, err
}
Expand Down

0 comments on commit 40df200

Please sign in to comment.