PaesslerAG / gval

Expression evaluation in golang
BSD 3-Clause "New" or "Revised" License
731 stars 82 forks source link

how to parse complex json with jsonpath? #95

Open fengnex opened 1 year ago

fengnex commented 1 year ago

value, err := gval.Evaluate($["response-time"]+" "+$["request.method"], map[string]interface{}{ "response-time": 100, "response-time1": 110, "request": { "method": "GET", "path": "/hello/2", } //here causes syntax error: unexpected newline, expecting comma or }, how to fix it? }, jsonpath.Language(), )

Please check the above code when want to include nested json content, which always leads to the above specified syntax error