Skip to content
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

Dereference error type field in REST API documentation #6421

Open
Schoumi opened this issue May 28, 2024 · 1 comment
Open

Dereference error type field in REST API documentation #6421

Schoumi opened this issue May 28, 2024 · 1 comment

Comments

@Schoumi
Copy link

Schoumi commented May 28, 2024

Describe the current behavior

The documentation says that code and error in JSON errors are now deprectated and replaced by type and details.
I'm not sure why you come to change type to an URL that leads nowhere (no documentation in the end) who is less clearer and parsable than code.

{
"type":"https://docs.joinpeertube.org/api-rest-reference.html#section/Errors/missing_two_factor",
"detail":"Missing two factor header",
"status":401,
"docs":"https://docs.joinpeertube.org/api-rest-reference.html#operation/getOAuthToken",
"code":"missing_two_factor",
"error":"Missing two factor header"
}

Steps to reproduce

No response

Describe the expected behavior

It's easier for client apps to make some treatment based on code than type now. if you really want to go to URI something like: "error://peertube/auth/missing_two_factor" will be better than we have now. We get that the error is from peertube, about auth.
If you don't go to separate error code in sub sections i'm not sure the type improve anything.

Additional information

No response

@Chocobozzz Chocobozzz changed the title Error JSON type shouldn't be an URL Dereference error type field in REST API documentation May 29, 2024
@Chocobozzz
Copy link
Owner

Hi,

We try to follow https://datatracker.ietf.org/doc/html/rfc7807#section-3.1, it's the reason why it's an URI.

But it would be better to update the documentation so the type can be correctly dereferenced.

We'll keep code field as I agree it's easier to parse (da7ccbb)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants