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

web metric jsonPath always returns values as strings #728

Closed
jessesuen opened this issue Sep 22, 2020 · 1 comment · Fixed by #731
Closed

web metric jsonPath always returns values as strings #728

jessesuen opened this issue Sep 22, 2020 · 1 comment · Fixed by #731
Labels
analysis Related to Analysis CRD bug Something isn't working

Comments

@jessesuen
Copy link
Member

Summary

According to #705 (comment), the json path library we use to parse arbitrary payloads in the web metric, returns result values as strings. It should return the result in the original format, so that functions like asFloat are not necessary if the data is already in the desired format.

Diagnostics

v0.9


Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritize the issues with the most 👍.

@jessesuen jessesuen added bug Something isn't working analysis Related to Analysis CRD labels Sep 22, 2020
@jessesuen
Copy link
Member Author

We're not using jsonParser to its fullest potential because we call the Execute convenience method which loses the information about the type. If we switch to jsonParser.FindResults(), we will get reflect.Values which indicate the original type.

	err = p.jsonParser.Execute(buf, data)   // this loses information
	if err != nil {
		return "", v1alpha1.AnalysisPhaseError, fmt.Errorf("Could not find JSONPath in body: %s", err)
	}
	out := buf.String()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analysis Related to Analysis CRD bug Something isn't working
Projects
None yet
1 participant