Misspelling a field in a strictly typed object presently results in a SchemaError::Multiple(FieldMissing, ExtraField) error. It would be cool to do some simple levenshtein distance on these two field names to suggest a typo was made if the similarity is high.
SchemaError {
kind: Multiple {
errors: [
SchemaError {
kind: FieldMissing { field: "not" },
},
SchemaError {
kind: ExtraField { field: "note" },
}
]
}
Would thereby be transformed into:
SchemaError {
kind: Typo {
extected: "not",
found: "note",
}
}
Misspelling a field in a strictly typed object presently results in a SchemaError::Multiple(FieldMissing, ExtraField) error. It would be cool to do some simple levenshtein distance on these two field names to suggest a typo was made if the similarity is high.
Would thereby be transformed into: