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

Standard for problem details [rfc-7807] #839

Closed
t1 opened this issue Jan 28, 2020 · 6 comments
Closed

Standard for problem details [rfc-7807] #839

t1 opened this issue Jan 28, 2020 · 6 comments

Comments

@t1
Copy link

t1 commented Jan 28, 2020

I'm working on producing and consuming problem details as specified in RFC-7807 for better generation and handling of http entities for application error conditions. I’ve just blogged about it: https://blog.codecentric.de/en/2020/01/rfc-7807-problem-details-with-spring-boot-and-jax-rs/

tl;dr: exceptions get mapped to rfc-7807 compliant application/problem+json http bodies on the server side and/or back to exceptions on the client side. You can rely on useful defaults for the fields or annotate your exceptions when you have specific requirements.

I have a potential implementation that runs on Payara and Open Liberty, and mostly on Widlfly 18... and on Spring Boot. I'd like this to become a standard in some form. I can see two options:

Option 1

Create a new MicroProfile standard, so it could be simply implemented also by Spring Boot. To hide the technical details the implementation, I'd like to hide the ResponseProcessingException. This option is what I'm currently working on.

Option 2

Integrate it directly into JAX-RS

What do you say?

@spericas
Copy link
Contributor

spericas commented Jan 28, 2020 via email

@chkal
Copy link
Contributor

chkal commented Feb 1, 2020

I'm not entirely sure if JAX-RS is the best place for this. On the one hand every application has to deal with problem/error reporting and people usually reinvent the wheel to implement it. So having out of the box support for such a standard would be great. On the other hand JAX-RS focuses on the core HTTP aspects of RESTful services and additional features like this are usually added by addon libraries or Microprofile (like the REST client for example).

Other thoughts?

@mkarg
Copy link
Contributor

mkarg commented Feb 1, 2020

JAX-RS should concentrate on the core of REST-over-HTTP, evertyhing else should be done by standards built ontop (like it was done for MVC, or like Microprofile does). It might happen (like it was the case for MVC) that JAX-RS needs to provide new extension points; I would be happy to discuss them once the need actually arises.

@t1
Copy link
Author

t1 commented Feb 2, 2020

@mkarg : that's perfectly fine with me. One change to JAX-RS would make the integration even easier: if there was a way to not wrap exceptions coming from filters, the mechanics could be hidden completely, as requested in #838.

@spericas
Copy link
Contributor

spericas commented Feb 5, 2020

@t1 Could we close this issue then?

@t1
Copy link
Author

t1 commented Feb 5, 2020

@spericas : I'm closing the issue now, as it seems to be the common thinking that it's nothing for jax-rs at the moment.

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

No branches or pull requests

4 participants