{"id":15010945,"url":"https://github.com/trskop/http-rfc7807","last_synced_at":"2026-02-28T10:06:22.122Z","repository":{"id":62436213,"uuid":"308895028","full_name":"trskop/http-rfc7807","owner":"trskop","description":"Problem Details for HTTP APIs as defined by RFC7807","archived":false,"fork":false,"pushed_at":"2022-11-28T03:31:40.000Z","size":152,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-08T04:38:58.540Z","etag":null,"topics":["haskell","rfc-7807","servant"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trskop.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-31T14:04:33.000Z","updated_at":"2023-02-03T14:18:57.000Z","dependencies_parsed_at":"2023-01-22T05:37:31.050Z","dependency_job_id":null,"html_url":"https://github.com/trskop/http-rfc7807","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/trskop/http-rfc7807","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trskop%2Fhttp-rfc7807","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trskop%2Fhttp-rfc7807/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trskop%2Fhttp-rfc7807/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trskop%2Fhttp-rfc7807/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trskop","download_url":"https://codeload.github.com/trskop/http-rfc7807/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trskop%2Fhttp-rfc7807/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29929653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T09:58:13.507Z","status":"ssl_error","status_checked_at":"2026-02-28T09:57:57.047Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haskell","rfc-7807","servant"],"created_at":"2024-09-24T19:37:42.439Z","updated_at":"2026-02-28T10:06:22.092Z","avatar_url":"https://github.com/trskop.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Problem Details for HTTP APIs (RFC7807)\n\nExtensible implementation of [RFC7807 — Problem Details for HTTP APIs\n](https://tools.ietf.org/html/rfc7807) in Haskell.\n\nRFC7807 defines HTTP API error responses that are quite informative. Very basic\nexample of such message could look like:\n\n```\nHTTP/1.1 404 Not Found\nTransfer-Encoding: chunked\nDate: Sun, 01 Nov 2020 22:28:42 GMT\nServer: Warp/3.3.13\nContent-Type: application/problem+json;charset=utf-8\nContent-Length: 251\n\n{\n  \"type\": \"https://example.com/docs/error#upload-to-missing-file\",\n  \"title\": \"File resource doesn't exist\",\n  \"status\": 404,\n  \"detail\": \"Cannot upload file content to a non-existent file.\",\n  \"documentId\": \"ae095978-2f7c-47aa-84dd-220be55195a5\"\n}\n```\n\n\n## Table of Contents\n\n(Links work on GitHub, but not on Hackage.)\n\n* [What does this package do?](#what-does-this-package-do)\n* [Why would I want to use this?](#why-would-i-want-to-use-this)\n* [When would I want to use something else?](#when-would-i-want-to-use-something-else)\n* [Usage examples](#usage-examples)\n\n\n## What does this package do?\n\nThis library provides a data type [`Rfc7807Error`\n](https://hackage.haskell.org/package/http-rfc7807/docs/Network-HTTP-RFC7807.html#t:Rfc7807Error)\nthat represents such error responses. It is designed to be extensible and to\nallow alternative representation of user defined fields. See module\n[`Network.HTTP.RFC7807`\n](https://hackage.haskell.org/package/http-rfc7807/docs/Network-HTTP-RFC7807.html)\nfor documentation.\n\nIn addition the package provides basic support for [`servant-server` package\n](https://hackage.haskell.org/package/servant-server). See\n[`Servant.Server.RFC7807` module documentation\n](https://hackage.haskell.org/package/http-rfc7807/docs/Servant-Server-RFC7807.html)\nfor more information and usage examples.\n\n\n## Why would I want to use this?\n\n[![Oh my](./doc/nixcraft-tweet-with-obscure-error-response.png)\n](https://twitter.com/nixcraft/status/1321898390209273856)\n\nThere are many ways common ways how API error responses are structured in HTTP\nAPIs. Using this one has few advantages:\n\n* It is standardised in [RFC7807 — Problem Details for HTTP APIs\n  ](https://tools.ietf.org/html/rfc7807). This can be leveraged in terms of\n  documentation, libraries built with it in mind, and not heaving to reinvent\n  something that people have put a lot of thought into.\n\n* Gives you a nice template that is still flexible and extensible. This is\n  important if we are retrofitting it into an existing API.\n\n* Documented by default. The `type` field is a URL, used correctly can allow us\n  to prevent a lot of issues by linking errors with their documentation.\n\n* Increasing level of detail. We have `type`, `title`, then `detail`, and\n  finally custom fields. This way we can progressively add more information\n  allowing users to easily debug issues.\n\n* Proxy friendly. When proxies are involved, so called layering, it is quite\n  easy to loose the original status code. This can also happen with some HTTP\n  libraries that do not retain the status code.\n\n* Probably more...\n\nThere's an interesting article \"[REST API Error Handling - Problem Details\nResponse by Guy Levin published on 23rd of May, 2018\n](https://blog.restcase.com/rest-api-error-handling-problem-details-response/)\"\nthat compares various stiles of error responses AKA problem details responses.\n\n\n## When would I want to use something else?\n\nThis response structure may not serve your needs if it's clashing with them.\nSome examples of that:\n\n* Your needs are in direct conflict with the [RFC7807 — Problem Details for\n  HTTP APIs](https://tools.ietf.org/html/rfc7807) standard. For example, fields\n  that are defined by the standard are reserved in your system or protocol\n  you're using.\n\n* When RFC7807 messages cannot easily be retrofitted into your API and you need\n  to preserve backward compatibility.\n\n* Probably more...\n\n\n## Usage examples\n\nGeneral usage (not tied to Servant) is documented in [module\n`Network.HTTP.RFC7807` in section Usage Examples\n](https://hackage.haskell.org/package/http-rfc7807/docs/Network-HTTP-RFC7807.html#usage-examples).\n\nBasic usage with Servant (actually `servant-server`) is documented in\n[module `Servant.Server.RFC7807` in section Usage Examples\n](https://hackage.haskell.org/package/http-rfc7807/docs/Servant-Server-RFC7807.html#usage-examples).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrskop%2Fhttp-rfc7807","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrskop%2Fhttp-rfc7807","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrskop%2Fhttp-rfc7807/lists"}