Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/float converter #95

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3151198
Adding JSON Path Parameters, Conditional Expressions and Converters
Jan 1, 2019
79f7072
Merge pull request #1 from mbordner/feature/value-conditional-and-con…
mbordner Jan 3, 2019
65c3bec
updating internal package paths to point to forked repos
Jan 3, 2019
e8a41f7
Merge pull request #2 from mbordner/feature/updating-imports-for-prod…
mbordner Jan 3, 2019
6a3b2d2
regex was not working on the actual string value
mbordner Jan 22, 2019
9332c3c
Merge pull request #3 from mbordner/feature/bug-fix-regex
mbordner Jan 22, 2019
bb64bb6
adding in a few new converters, and a new transform
mbordner Jan 23, 2019
c8785a4
Merge pull request #4 from mbordner/feature/len-split-ordered-shift
mbordner Jan 23, 2019
a25ba10
bug fix for numbers with leading zeros
mbordner Jan 23, 2019
6ff1129
Merge pull request #5 from mbordner/feature/buf-fix-ston
mbordner Jan 23, 2019
aa53e96
added not converter
mbordner Jan 23, 2019
7b09ed5
Merge pull request #6 from mbordner/feature/not-converter
mbordner Jan 23, 2019
2649db1
adding ability to define the regex config as an array of configs
mbordner Mar 26, 2019
78aa110
Merge pull request #7 from mbordner/feature/regex-array-of-config-sup…
mbordner Mar 26, 2019
456c681
bug fix
mbordner Mar 26, 2019
94b9d29
Merge pull request #8 from mbordner/feature/regex-array-of-config-sup…
mbordner Mar 26, 2019
f41e5a9
adding merge transform
mbordner May 23, 2019
061e4de
Merge pull request #9 from mbordner/feature/merge-transform
mbordner May 23, 2019
4e207ad
adding split and join converters
mbordner Jun 5, 2019
65152a4
Merge pull request #10 from mbordner/feature/join-split-converters
mbordner Jun 5, 2019
a5130aa
fixing bug with array paths and conditional params
mbordner Jun 5, 2019
c88735b
Merge pull request #11 from mbordner/feature/bug-fix-array-conditiona…
mbordner Jun 5, 2019
096461e
Merge branch 'master' into feature/bug-fix-array-conditional-paths
mbordner Jun 5, 2019
69c8c33
bug fix on conditional arrays
mbordner Jun 5, 2019
1da974e
Merge pull request #12 from mbordner/feature/bug-fix-array-conditiona…
mbordner Jun 5, 2019
4bd48c6
adding in support to get the length of array values
mbordner Jun 6, 2019
8b84c3f
Merge pull request #13 from mbordner/feature/len-to-support-arrays
mbordner Jun 6, 2019
b5cf60d
adding float converter
mbordner Jun 6, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
regex was not working on the actual string value
it was actually working on the json encoded representation of the string value
  • Loading branch information
mbordner committed Jan 22, 2019
commit 6a3b2d2cd9341e381aedea88a27975aae00d79fc
6 changes: 5 additions & 1 deletion converter/regex.go
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ import (
"errors"
"github.com/mbordner/kazaam/transform"
"regexp"
"strconv"
)

type regexSpec struct {
@@ -53,7 +54,10 @@ func (r *Regex) Convert(jsonData []byte, value []byte, args []byte) (newValue []
return
}

newValue = re.ReplaceAll(jsonValue.GetData(), []byte(*spec.Replace))
src := jsonValue.GetStringValue()
newValue = re.ReplaceAll([]byte(src), []byte(*spec.Replace))

newValue = []byte(strconv.Quote(string(newValue)))

} else {
err = errors.New("regex not defined")