jax rs - JAX-RS and @Produces ability to match on regex -
i'm writing restful web service requires versioning. way want go using media type in header this.
example of request:
accept: application/vnd.test.books.v1+xml i have endpoint of
@get @path("/test") @produces("application/vnd.test.books.v1+xml") public response geta(){ ... } i have regex matching versions. want match on accept header of application/vnd.test.books.*+xml . version in case. tried following no lucks.
@get @path("/test") @produces("application/vnd.test.books*+xml") public response getb(){ ... } what want ability down line have endpoint v1 above v2 want different end point.
you must explicitly list mime types method @produces:
@produces(value = {"application/vnd.test.books.v2+xml", "application/vnd.test.books.v3+xml", "application/vnd.test.books.v4+xml"})
Comments
Post a Comment