Implement https://pkg.go.dev/errors#Unwrap on internal errors like openapi3filter.RequestError and openap3.SchemaError so we can use errors.Is/errors.As to inspect them
My specific use case is that I have a *openapi3filter.RequestError where the Err property is a *openapi3.SchemaError, and I want to call JSONPointer() on it to get the path where the error occurred. Right now that looks like this:
var e *openapi3filter.RequestError
if goerrors.As(err, &e) {
var e2 *openapi3.SchemaError
if goerrors.As(e.Err, &e2) {
path := e2.JSONPointer()
fmt.Println(path)
}
}
It could look like this:
var e *openapi3.SchemaError
if goerrors.As(err, &e) {
path := e.JSONPointer()
fmt.Println(path)
}
Implement https://pkg.go.dev/errors#Unwrap on internal errors like
openapi3filter.RequestErrorandopenap3.SchemaErrorso we can useerrors.Is/errors.Asto inspect themMy specific use case is that I have a
*openapi3filter.RequestErrorwhere the Err property is a*openapi3.SchemaError, and I want to call JSONPointer() on it to get the path where the error occurred. Right now that looks like this:It could look like this: