Closed rtamalin closed 2 months ago
Explored couple of libraries for this issue: https://pkg.go.dev/github.com/santhosh-tekuri/jsonschema/v5 https://pkg.go.dev/github.com/go-playground/validator/v10
They are used for different purposes and in our case, the go-playground/validator which is used for value validations for structs and individual fields based on tags should suffice as we have the go structs defined to match the json payloads.
The telemetry server should validate that received request payloads conform to the required structure specification, and fail any requests that don't.
Provisionally consider using https://pkg.go.dev/github.com/santhosh-tekuri/jsonschema/v5 for the validation.