Пример #1
0
func getDescription(err gojsonschema.ResultError) string {
	if err.Type() == "invalid_type" {
		if expectedType, ok := err.Details()["expected"].(string); ok {
			return fmt.Sprintf("must be a %s", humanReadableType(expectedType))
		}
	}

	return err.Description()
}