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
Repository of common Problem types #7
Comments
Unlike relation type name ( Also, I am working on API for such a repository https://github.com/sdatspun2/error-catalog-service (When you read, replace "Error Type" with "Problem Type" and "Error Catalog" with "Problem Type Repository"). I would like to submit it here to evolve it if there is interest. |
My concern here, and why I raised this ticket, is less to do with APIs
using the same value for different meanings, and instead to do with APIs
using different values for the same meaning. Mostly it makes API design
that bit easier if there is a well known value to use for what you're
trying to indicate.
…On Sun, 31 Jan 2021, 17:20 Sanjay Dalal, ***@***.***> wrote:
Unlike relation type name (self or item), problem type` is a URI in 7807.
Is there any other example of a repository of entities where each entity is
uniquely addressable?
Also, I am working on API for such a repository
https://github.com/sdatspun2/error-catalog-service (When you read,
replace "Error Type" with "Problem Type" and "Error Catalog" with "Problem
Type Repository"). I would like to submit it here to evolve it if there is
interest.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAQEGB7BDO32QVU2OTYXDTS4WGNVANCNFSM4WYQPZJA>
.
|
There are a couple of ways to go here:
Because types are required to be URIs, avoiding conflicts (one of the main reasons to use a registry) isn't relevant; it would be more to aid discovery. If we wanted some sort of quality filter on it, we'd probably use an IANA registry, and would need a process around that (e.g., expert review, IETF review; see RFC8126 Section 4). Note that 7087 allows relative URIs in the P.S. Resource Not Found and Authentication Failure are already HTTP status codes -- 404 and 401, respectively (unless you mean non-HTTP auth in the latter case). |
These are already HTTP status codes, but it's not unreasonable for APIs to want to always return a Problem response for any error. Sometimes it's easier to develop the server code that way (e.g. in Rust it's very verbose to have many different response types.) Sometimes it's easier to allow clients to always assume an Given that though, it means that people start to mint URIs for problem types that directly correspond to HTTP status codes. And, odds are, different people do it differently. That's a key example where some standard values would just make that a little bit easier. For example, I've started using values like |
The RFC recommends that |
Ah - I'd totally missed that paragraph! That does make a lot of sense,
especially when coupled with the absence of the "type" parameter mapping on
to "about:blank". :)
…On Thu, 4 Feb 2021 at 23:32, Mark Nottingham ***@***.***> wrote:
The RFC recommends that about:blank be used in this situation. We
intentionally did not have per-status-code values, because that would
encourage developers to ignore the real status code, and because
duplicating values at different layers is a vector for bugs and security
issues.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAQEGAO2P4YQSS3XB73MOLS5MVBVANCNFSM4WYQPZJA>
.
|
For "standard" problem types, would folks be willing to stomach the Using Another option would be minting our own URI scheme, to make something like |
I think we need to resolve #11 before we can decide on the format. |
I guess the form we go for depends on some other things. If we decide (per #11 as @asbjornu says) that the value should be a URI, and that it should resolve to documentation, then something like Personally speaking, I'm fine with the I'm less keen on the idea of a new scheme. It is obvious what's happening, but it does start to look like all problems must be in that scheme, which then potentially defeats the point of #11 in the first place. Also, (and I might be missing things here) it seems that the only real benefit of |
In the meeting, folks seemed to pretty strongly lean towards an IANA registry with some bar to entry (TBD). |
See #24 for a proposal. |
thanks for #24 , @mnot! i like it, but my concern is a bit that if we have a registry, wouldn't it make more sense to suggest using a URN scheme or a URN pattern ( |
thanks for the pointer, i forgot about that one... i still think that using a URN is cleaner and more google friendly (seeing that automated dereferencing is not the goal here), but of course both options technically work. maybe this would be something useful to present as a choice to be made in the next meeting.
|
just in case anybody is interested in a general discussion of why and how to use registries, here's something i wrote a while ago that discusses various aspects of the general pattern: https://datatracker.ietf.org/doc/html/draft-wilde-registries-03 |
Discussed in 111: no strong feelings about URI scheme; a bit of preference for urn. |
I'm going to go ahead and merge as is; we can address the URI scheme part as our thinking on that develops. |
(I'm not sure if this is the correct place to propose this, so apologies if not!)
As RFC-7807 gains wider-spread adoption, it is becoming the case that more and more APIs are returning effectively the same problems with different values for the fields. This makes it difficult to work across different APIs, because you need to understand that different problems from those APIs actually mean the same thing.
Common examples that you might expect to see include:
If-Match
header on aPUT
request has the wrong value)It seems that it would be useful to have a repository of these common problem types that can then be reused across APIs, so that ideally these common situations can be handled in the exact same way on the client.
Effectively the same idea as the standard list of Link Relations, whereby all clients that see a link relation of, for example,
self
oritem
know what they mean regardless of the API that produced them.The text was updated successfully, but these errors were encountered: