SUSE / telemetry-server

Proof of Concept Telemetry Server scaffolding
Apache License 2.0
2 stars 0 forks source link

Request Handling: Implement validation mechanism for received requests #1

Closed rtamalin closed 2 months ago

rtamalin commented 2 months ago

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.

mbelur commented 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.