Comments (8)
- Issue Imported From: https://github.com/jax-rs/api/issues/20
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: @glassfishrobot
from rest.
@glassfishrobot Commented
Reported by [email protected]
from rest.
@glassfishrobot Commented
sandoz said:
It's a bit of a hack but one can recast rather than wrap state.
public class Main {
public static class Response<T> {
private final T entity;
private Response(T entity) {
this.entity = entity;
}
public T getEntity() {
return entity;
}
public static <T> ResponseBuilder<T> start() {
return new ResponseBuilder<T>();
}
public static class ResponseBuilder<T> {
private T entity;
public ResponseBuilder<T> header(String name, String value) {
return this;
}
public <V> ResponseBuilder<V> entity(V ent) {
ResponseBuilder<V> vThis = (ResponseBuilder<V>)this;
vThis.entity = ent;
return vThis;
}
public Response<T> build() {
return new Response<T>(entity);
}
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Response<String> stringResponse = Response.start()
.entity(1)
.entity("String")
.header("Content-Type", "cheese")
.build();
}
}
}
from rest.
@glassfishrobot Commented
@mpotociar said:
Targeting for 2.0 PFD, but might need to be moved to 2.0 MR.
from rest.
@glassfishrobot Commented
@mpotociar said:
Deferring to post-2.0 evaluation.
Since we would end up using type-erased Response in a lot of places, perhaps it would be better to consider introducing a generic response sub-class instead (like in Jersey 1.x).
from rest.
@glassfishrobot Commented
c.beikov said:
What about custom Response beans similar to what resteasy offers with ResponseObjects(https://github.com/resteasy/Resteasy/blob/master/jaxrs/resteasy-jaxrs/src/test/java/org/jboss/resteasy/test/finegrain/client/ResponseObjectTest.java)??) That would also allow rich client APIs.
from rest.
@glassfishrobot Commented
Issue-Links:
is duplicated by
JAX_RS_SPEC-108
from rest.
@glassfishrobot Commented
This issue was imported from java.net JIRA JAX_RS_SPEC-15
from rest.
Related Issues (20)
- Split com.sun.ts.tests.jaxrs.spec.provider.standardhaspriority into two HOT 1
- ee.jakarta.tck.ws.rs.ee.rs.container.requestcontext.JAXRSClientIT should be excluded from Core Profile executions HOT 2
- ee.jakarta.tck.ws.rs.ee.rs.core.securitycontext.basic.JAXRSBasicClientIT should be excluded from Core Profile executions HOT 8
- TCK Challenge: `!Future.isDone` Issues with `ee.jakarta.tck.ws.rs.jaxrs21.ee.client.executor.rx.JAXRSClientIT` & `ee.jakarta.tck.ws.rs.jaxrs21.ee.client.rxinvoker.JAXRSClientIT` HOT 7
- TCK Challenge: Improper use of final keyword in ee.jakarta.tck.ws.rs.spec.contextprovider.JsonbContextProviderIT$EchoApplication and ee.jakarta.tck.ws.rs.spec.client.exceptions.ClientExceptionsIT$StatusApplication HOT 23
- Clarify that java Se support in Section 2.3 HOT 1
- TCK: The ee.jakarta.tck.ws.rs.sebootstrap.SeBootstrapIT tests should be optional HOT 6
- Change Section 2.3. Publication to clarify that Java SE support is optional for compliant implementations HOT 1
- CDI alignment: Servlet Spec beans Qualifier needed. HOT 8
- Seeking Clarification on the Mutability of the Response Headers Views HOT 14
- Explore alignment with CDI lite and built-time injection support HOT 1
- TCK Challenge: Rest TCK should not use "suspicious sequence" in URI testing HOT 14
- Link to API not working on website HOT 2
- MediaType - Missing JSON Merge Patch type HOT 3
- Publish TCK 3.1.3 (latest) to maven staging repository HOT 23
- Question: How to build from source and test in local machine? HOT 2
- TCK failure messages use toString() on the message object array HOT 1
- Support of RFC 9110 "new" statuses HOT 7
- javax.ws.rs.core.StreamingOutput HOT 2
- Response.Status does not include '422 unprocessable entity' HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rest.