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

Missing status codes in Response class #993

Closed
reschke opened this issue Jul 7, 2021 · 13 comments
Closed

Missing status codes in Response class #993

reschke opened this issue Jul 7, 2021 · 13 comments
Assignees
Labels
api enhancement New feature or request
Milestone

Comments

@reschke
Copy link

reschke commented Jul 7, 2021

See #582, which was closed for reasons that escape me.

There are likely more status codes missing, see the IANA registry at https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml. It would also be good to update comments to refer to current RFCs, not obsoleted ones.

cc: @mkarg

@spericas
Copy link
Contributor

spericas commented Jul 7, 2021

The reason is there:

"@mithunsasidharan Are you still interested in working on this? If so, could you rebase against `3.1-SNAPSHOT" and update the pull request accordingly?"

Needs to be resubmitted for 3.1 using the correct branch.

@spericas spericas changed the title missing status codes in jaxrs-api/src/main/java/javax/ws/rs/core/Response.java Missing status codes in Response class Jul 7, 2021
@spericas spericas added the api label Jul 7, 2021
@spericas spericas added this to the 3.1 milestone Jul 7, 2021
@spericas spericas added the enhancement New feature or request label Jul 7, 2021
@mithunsasidharan
Copy link

@spericas : Is this something thats already been pickedup ? If not I'd like to work on it !

@spericas
Copy link
Contributor

@mithunsasidharan Feel free to work on it. See previous work and suggestion by @reschke.

@spericas
Copy link
Contributor

@mithunsasidharan Any update on this work?

@jelemux
Copy link
Contributor

jelemux commented Oct 18, 2021

If @mithunsasidharan isn't responding, I'd be willing to tackle this.
Maybe we wait a week or so and if we hear nothing, I'll create a PR?
Is that okay for everybody? @spericas @mkarg WDYT?

@mkarg
Copy link
Contributor

mkarg commented Oct 21, 2021

@jelemux There wer months of waiting, so I'd say, he lost interest. Please go ahead, we would be delighted to receive your PR.

@jelemux
Copy link
Contributor

jelemux commented Oct 21, 2021

Thank you @mkarg!

I suppose there's a reason that there are no 100 status codes in there, right?
Any other status codes that have been left out by choice and that I should not add?

@mkarg
Copy link
Contributor

mkarg commented Oct 21, 2021

JAX-RS is not an HTTP wrapper (like Servlet API), it is solely and specifically a REST API, hence not all the codes make sense. So I would say, only those should be added that really are of general interest for REST applications.

@jelemux
Copy link
Contributor

jelemux commented Nov 8, 2021

Sorry for the late response, I've caught the flu and then had a week of vacation after I recovered.

I went through all the missing status codes and singled those out that MAY be of general interest for REST applications.
I've documented my findings on this wiki page. Feel free to go through them and comment your opinions here.

In short, those are the status codes that may be of general interest to REST applications:

I think it is best to create separate PRs for each of these since there may be arguments against some of these that don't concern the others.
The only exception being the argument that those are all only Proposed Standard RFCs, which has already been discussed, but with no clear conclusion (to me). Does this argument still stand?

@jelemux
Copy link
Contributor

jelemux commented Nov 8, 2021

What may not be of general interest to REST applications but still came up is WebDAV.
The JAXRS specification states under goals:

The API will provide high level support for common HTTP usage patterns and will be sufficiently flexible to support a variety of HTTP applications including WebDAV and the Atom Publishing Protocol.

Because additional status codes can be added by creating an implementation of StatusType, it is my opinion that this goal is fulfilled since the API is sufficiently flexible. If you (and others) agree, then I don't think that further discussion on this topic is necessary.

@andymc12
Copy link
Contributor

andymc12 commented Nov 8, 2021

@jelemux I agree with your assessment on the wiki. I'm +1 for adding 300, 308 and 451. I'm +0 or -1 on the rest. I also agree that separate PRs would be the most expedient - I suspect that 308 will be the easiest to get in, while 300 and 451 might take some discussion. Thanks for putting this together! I think it will also help us in the future (for example, when JAX-RS officially supports HTTP/2, etc.) to know which HTTP response codes we should add.

@mkarg
Copy link
Contributor

mkarg commented Nov 8, 2021

I never needed 203; I doubt that it is actually of common use.

WebDAV is definitively an outdated technology which we should not start to explicitly support. In fact, if someone wants to use WebDAV with JAX-RS, he can simply use the ready-to-use extension WebDAV for JAX-RS which (for those who don't know) was the reason for me adding the StatusType interface back then, and which in fact simply does what you propose... (it's always good to know some history ;-) ).

@jelemux
Copy link
Contributor

jelemux commented Nov 15, 2021

Now that the codes have been added, I think this can be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants