.add(Methods.PATCH, "/v2/fake", new HttpHandler() {
public void handleRequest(HttpServerExchange exchange) throws Exception {
exchange.getResponseSender().send("testClientModel");
}
})
.add(Methods.POST, "/v2/fake", new HttpHandler() {
public void handleRequest(HttpServerExchange exchange) throws Exception {
exchange.getResponseSender().send("testEndpointParameters");
}
})
.add(Methods.GET, "/v2/fake", new HttpHandler() {
public void handleRequest(HttpServerExchange exchange) throws Exception {
exchange.getResponseSender().send("testEnumParameters");
}
Hi Steve Hu,Most of Undertow built-in Handlers expects a HttpString to identify which HTTP Method you intent to handle. Indeed, it does not have a PATCH but I do believe you can easily create your own HttpString with something like the sample code bellow:public static final HttpString PATCH = new HttpString("PATCH");Also, you can create your own handler, if none of available Handlers fit your needs. It is quite easy... Feel free to e-mail me if you need some help with it.Regards,On Mon, Oct 3, 2016 at 9:21 AM Steve Hu <stevehu@gmail.com> wrote:Hi Tomaz,Thanks for the quick response. The reason I said undertow doesn't support PATCH is based on this file.https://github.com/undertow-io/undertow/blob/master/core/ src/main/java/io/undertow/ util/Methods.java As you can see there is no patch method available and I even searched the entire source tree with patch keyword.Steve______________________________On Mon, Oct 3, 2016 at 7:41 AM, Tomaž Cerar <tomaz.cerar@gmail.com> wrote:tomazI would look into your handler chain configuration to see which one is not handling PATCH properly.Undertow as server supports all http methods.It is up to handlers in handler chain that might choose not to support some methods.
--On Sun, Oct 2, 2016 at 9:50 PM, Steve Hu <stevehu@gmail.com> wrote:I am building a REST API framework on top of undertow core to support design driven implementation from Open API (Swagger) specifications for security and validation during runtime. From swagger-codegen result, I found that undertow doesn't support http method PATCH. Is there a reason it is not supported? or any workaround? Thanks.
_______________________________________________
undertow-dev mailing list
undertow-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/undertow-dev _________________
undertow-dev mailing list
undertow-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/undertow-dev