google / google/jsonschema-go

Validation errors are too verbose

Open
#20 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
478
Forks
37
PR merge metrics
No merged PRs in 30d

Description

While investigating certain validation errors for the Go SDK, I noticed that they're rather verbose, which is undesirable for both human and LLM consumption. For example:

> "validating\n\t\u0026map[]\nagainst\n\t {\"type\":\"object\",\"required\":[\"In\"],\"properties\":{\"In\":{\"type\":\"string\",\"description\":\"the input\"}},\"additionalProperties\":false}:\n validating root: required: missing properties: [\"In\"]"

This is just saying that the input is missing required property "In", but it's obscured by printing the input and the schema.

We should simplify these errors, or provide an error API to access the inner error.

CC @jba @samthanawalla @mazas-google

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.