Open gtrevg opened 3 years ago
After some testing with ozzo-validation
, I ran into issues with it trying to validate pointers to ints. When testing if the i > 1
, the result would always pass even when the value was 0
. It seems like pointers to ints are not supported.
I then replaced this with gojsonschema
validation. Ideally, jsonschema is expressive enough to cover both the sender and receiver validation.
We should also look into OpenAPI and see if they have something.
https://github.com/getkin/kin-openapi could support validation based on an OpenAPI spec.
There may be a way to use the basic payload validation definition plus an object.
Background
There are a number of cases where we need to apply some sort of data validation:
Each may have unique constraints that should be addressed. For instance:
Research
A quick search produced the following results
Thoughts
Originally I thought we could lean into json schema (since it can apply to YAML docs as well), but I'm curious how json schema would go about addressing common types, such as UUID, email, URLs.