-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First version #1
Conversation
errorResponse :: Status -> Text -> NonEmpty Text -> Response | ||
errorResponse status msg = | ||
responseLBS status [(hContentType, "application/json")] | ||
. encode | ||
. Error msg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it sort of ironic that this response probably violates your openapi spec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My original plan was to derive ToSchema Error
and export it, then users of this library could add it to their own OpenApi
. This would make our own responses valid according to ourselves.
I think I can still do that, but I realized that users might already have 400 responses specified throughout, so I can't exactly picture yet how to incorporate this schema. I ended up implicitly leaning on the "well then drop down to validate
and change respondError
if this matters" as the solution.
Co-authored-by: Chris Martin <ch.martin@gmail.com>
- Remove Settings type - Remove ValidationErrors type - Remove ValidateOption internals - Introduce ValidateT - Separate request vs response errors - Separate schema-not-found, etc as errors - Document higher and lower-level usage
@chris-martin I think this is ready to merge, if not release. Check out the |
Starting with the straightforward linear search approach seems like a wise way to go. |
Rendered README.